Lines Matching defs:obj2
49 var obj2 = {};
50 assertTrue(Object.isExtensible(obj2));
51 obj2.x = 42;
52 assertEquals(42, obj2.x);
53 assertTrue(Object.isExtensible(obj2));
55 Object.preventExtensions(obj2);
56 assertEquals(42, obj2.x);
58 obj2.y = 42;
59 // obj2.y should still be undefined.
60 assertEquals(undefined, obj2.y);
62 obj2.x = 43;
63 assertEquals(43, obj2.x)
65 obj2.y = new function() { return 42; };
66 // obj2.y should still be undefined.
67 assertEquals(undefined, obj2.y);
68 assertEquals(43, obj2.x)
71 Object.defineProperty(obj2, "y", {value: 42});
76 // obj2.y should still be undefined.
77 assertEquals(undefined, obj2.y);
78 assertEquals(43, obj2.x);
80 obj2[1] = 42;
81 assertEquals(undefined, obj2[1]);
142 obj2 = { prop1: 3, prop2: 4 };
143 assertTrue(%HaveSameMap(obj, obj2));
145 Object.preventExtensions(obj2);
147 assertFalse(Object.isExtensible(obj2));
149 assertFalse(Object.isSealed(obj2));
150 assertTrue(%HaveSameMap(obj, obj2));
154 obj2 = { prop1: 3, prop2: 4, 150: 'bar' };
155 assertTrue(%HaveSameMap(obj, obj2));
157 Object.preventExtensions(obj2);
159 assertFalse(Object.isExtensible(obj2));
161 assertFalse(Object.isSealed(obj2));
162 assertTrue(%HaveSameMap(obj, obj2));