Lines Matching refs:obj

45 var obj = { x: 42, z: 'foobar' };  variable
46 var desc = Object.getOwnPropertyDescriptor(obj, 'x');
51 desc = Object.getOwnPropertyDescriptor(obj, 'z');
56 assertTrue(Object.isExtensible(obj));
57 assertFalse(Object.isSealed(obj));
59 Object.seal(obj);
62 assertFalse(Object.isExtensible(obj));
63 assertTrue(Object.isSealed(obj));
67 assertFalse(Object.isFrozen(obj));
70 obj.foo = 42;
71 assertEquals(obj.foo, undefined);
73 desc = Object.getOwnPropertyDescriptor(obj, 'x');
78 desc = Object.getOwnPropertyDescriptor(obj, 'z');
85 obj.x = "43";
86 assertEquals("43", obj.x);
187 obj = [1, 2, 3];
194 push_call(obj);
195 pop_call(obj);
198 Object.seal(obj);
199 assertThrows(function() { push_call(obj); }, TypeError);
200 assertThrows(function() { pop_call(obj); }, TypeError);
206 assertDoesNotThrow(function() { obj.push(); });
207 assertThrows(function() { obj.push(3); }, TypeError);
208 assertThrows(function() { obj.pop(); }, TypeError);
209 assertThrows(function() { obj.shift(3); }, TypeError);
210 assertDoesNotThrow(function() { obj.unshift(); });
211 assertThrows(function() { obj.unshift(1); }, TypeError);
212 assertThrows(function() { obj.splice(0, 0, 100, 101, 102); }, TypeError);
213 assertDoesNotThrow(function() { obj.splice(0,0); });
222 obj = [1, 2, 3];
228 push_call(obj);
229 shift_call(obj);
234 push_call(obj);
235 shift_call(obj);
238 Object.seal(obj);
239 assertThrows(function() { push_call(obj); }, TypeError);
240 assertThrows(function() { shift_call(obj); }, TypeError);
247 obj = [1,2,3];
248 Object.seal(obj);
249 assertDoesNotThrow(function() { obj.splice(0,1,100); });
250 assertEquals(100, obj[0]);
251 assertDoesNotThrow(function() { obj.splice(0,2,1,2); });
252 assertDoesNotThrow(function() { obj.splice(1,2,1,2); });
254 assertDoesNotThrow(function() { obj.splice(1,2000,1,2); });
255 assertThrows(function() { obj.splice(0,0,1); }, TypeError);
256 assertThrows(function() { obj.splice(1,2000,1,2,3); }, TypeError);
259 obj = { x: 42, y: 'foo' }; variable
260 Object.defineProperty(obj, 'y', {enumerable: false});
261 Object.seal(obj);
262 assertTrue(Object.isSealed(obj));
263 assertFalse(Object.isFrozen(obj));
264 desc = Object.getOwnPropertyDescriptor(obj, 'x');
266 desc = Object.getOwnPropertyDescriptor(obj, 'y');
270 obj = { x: 42, y: 'foo' }; variable
271 assertTrue(%HasFastProperties(obj));
272 Object.seal(obj);
273 assertTrue(Object.isSealed(obj));
274 assertFalse(Object.isFrozen(obj));
275 assertTrue(%HasFastProperties(obj));
278 obj = { prop1: 1, prop2: 2 }; variable
280 assertTrue(%HaveSameMap(obj, obj2));
281 Object.seal(obj);
283 assertTrue(Object.isSealed(obj));
285 assertFalse(Object.isFrozen(obj));
287 assertTrue(%HaveSameMap(obj, obj2));
290 obj = { prop1: 1, prop2: 2, 75: 'foo' }; variable
292 assertTrue(%HaveSameMap(obj, obj2));
293 Object.seal(obj);
295 assertTrue(Object.isSealed(obj));
297 assertFalse(Object.isFrozen(obj));
298 assertFalse(Object.isFrozen(obj));
299 assertTrue(%HaveSameMap(obj, obj2));
302 obj = { prop: 'thing' }; variable
303 Object.seal(obj);
304 assertTrue(Object.isSealed(obj));
305 assertFalse(Object.isFrozen(obj));
306 obj[0] = 'hello';
307 assertFalse(obj.hasOwnProperty(0));
311 obj = { };
313 obj['x' + i] = i;
316 Object.defineProperty(obj, 'accessor', {
323 assertFalse(%HasFastProperties(obj));
324 Object.seal(obj);
325 assertFalse(%HasFastProperties(obj));
326 assertTrue(Object.isSealed(obj));
327 assertFalse(Object.isFrozen(obj));
328 assertFalse(Object.isExtensible(obj));
330 desc = Object.getOwnPropertyDescriptor(obj, 'x' + i);
333 assertEquals(42, obj.accessor);
335 obj.accessor = 'ignored value';
353 obj = {};
354 Object.defineProperty(obj, 'accessor', {
360 assertTrue(%HasFastProperties(obj));
361 Object.seal(obj);
362 assertTrue(Object.isSealed(obj));
363 assertTrue(%HasFastProperties(obj));
364 assertEquals(42, obj.accessor);
366 obj.accessor = 'ignored value';
374 obj = {};
375 Object.defineProperty(obj, 'accessor2', {
381 obj.data = 'foo';
382 assertTrue(%HasFastProperties(obj));
383 Object.seal(obj);
384 assertTrue(%HasFastProperties(obj));
385 assertTrue(Object.isSealed(obj));