Lines Matching defs:obj
28 function obj()
34 function test(obj)
36 obj.c =3;
37 obj.b =4;
38 delete obj.a;
41 for (key in obj)
42 result += ("(" + key + ":" + obj[key] + ")");
43 if (Object.isSealed(obj))
45 if (Object.isFrozen(obj))
47 if (Object.isExtensible(obj))
52 function seal(obj)
54 Object.seal(obj);
55 return obj;
58 function freeze(obj)
60 Object.freeze(obj);
61 return obj;
64 function preventExtensions(obj)
66 Object.preventExtensions(obj);
67 return obj;
87 shouldBe('test(obj())', '"(b:4)(c:3)E"'); // extensible, can delete a, can modify b, and can add c
88 shouldBe('test(preventExtensions(obj()))', '"(b:4)"'); // <nothing>, can delete a, can modify b, and CANNOT add c
89 shouldBe('test(seal(obj()))', '"(a:1)(b:4)S"'); // sealed, CANNOT delete a, can modify b, and CANNOT add c
90 shouldBe('test(freeze(obj()))', '"(a:1)(b:2)SF"'); // sealed and frozen, CANNOT delete a, CANNOT modify b, and CANNOT add c
111 var obj = new Constructor();
112 obj.foo = 2;
113 shouldBe('obj.foo', '1');