Lines Matching refs:MyObject
78 shouldBe("typeof MyObject", "function"); // our object implements 'call'
79 MyObject.cantFind = 1;
80 shouldBe("MyObject.cantFind", undefined);
81 MyObject.regularType = 1;
82 shouldBe("MyObject.regularType", 1);
83 MyObject.alwaysOne = 2;
84 shouldBe("MyObject.alwaysOne", 1);
85 MyObject.cantDelete = 1;
86 delete MyObject.cantDelete;
87 shouldBe("MyObject.cantDelete", 1);
88 shouldBe("delete MyObject.throwOnDelete", "an exception");
89 MyObject.cantSet = 1;
90 shouldBe("MyObject.cantSet", undefined);
91 shouldBe("MyObject.throwOnGet", "an exception");
92 shouldBe("MyObject.throwOnSet = 5", "an exception");
93 shouldBe("MyObject('throwOnCall')", "an exception");
94 shouldBe("new MyObject('throwOnConstruct')", "an exception");
95 shouldBe("'throwOnHasInstance' instanceof MyObject", "an exception");
99 for (var p in MyObject) {
107 pass("MyObject.myPropertyName was enumerated");
109 fail("MyObject.myPropertyName was not enumerated");
112 pass("MyObject.regularType was enumerated");
114 fail("MyObject.regularType was not enumerated");
116 var alwaysOneDescriptor = Object.getOwnPropertyDescriptor(MyObject, "alwaysOne");
118 shouldBe('alwaysOneDescriptor.value', MyObject.alwaysOne);
121 var cantFindDescriptor = Object.getOwnPropertyDescriptor(MyObject, "cantFind");
123 shouldBe('cantFindDescriptor.value', MyObject.cantFind);
128 Object.getOwnPropertyDescriptor(MyObject, "throwOnGet");
132 var myPropertyNameDescriptor = Object.getOwnPropertyDescriptor(MyObject, "myPropertyName");
134 shouldBe('myPropertyNameDescriptor.value', MyObject.myPropertyName);
139 Object.getOwnPropertyDescriptor(MyObject, "hasPropertyLie");
143 shouldBe('Object.getOwnPropertyDescriptor(MyObject, "doesNotExist")', undefined);
145 myObject = new MyObject();
147 shouldBe("delete MyObject.regularType", true);
148 shouldBe("MyObject.regularType", undefined);
149 shouldBe("MyObject(0)", 1);
150 shouldBe("MyObject()", undefined);
151 shouldBe("typeof myObject", "object");
152 shouldBe("MyObject ? 1 : 0", true); // toBoolean
153 shouldBe("+MyObject", 1); // toNumber
154 shouldBe("(MyObject.toString())", "[object MyObject]"); // toString
155 shouldBe("String(MyObject)", "MyObjectAsString"); // type conversion to string
156 shouldBe("MyObject - 0", 1); // toNumber
162 shouldBe("myObject instanceof MyObject", true);
163 shouldBe("(new Object()) instanceof MyObject", false);
165 shouldThrow("MyObject.nullGetSet = 1");
166 shouldThrow("MyObject.nullGetSet");
167 shouldThrow("MyObject.nullCall()");
168 shouldThrow("MyObject.hasPropertyLie");
235 shouldBe("undefined instanceof MyObject", false);