shouldBe("typeof myObject", "object");
shouldBe("MyObject ? 1 : 0", true); // toBoolean
shouldBe("+MyObject", 1); // toNumber
+shouldBe("(Object.prototype.toString.call(MyObject))", "[object MyObject]"); // Object.prototype.toString
shouldBe("(MyObject.toString())", "[object MyObject]"); // toString
-shouldBe("String(MyObject)", "MyObjectAsString"); // type conversion to string
+shouldBe("String(MyObject)", "MyObjectAsString"); // toString
shouldBe("MyObject - 0", 1); // toNumber
+shouldBe("MyObject.valueOf()", 1); // valueOf
shouldBe("typeof MyConstructor", "object");
constructedObject = new MyConstructor(1);
shouldBe("myObject instanceof MyObject", true);
shouldBe("(new Object()) instanceof MyObject", false);
+shouldThrow("new MyBadConstructor()");
+
MyObject.nullGetSet = 1;
shouldBe("MyObject.nullGetSet", 1);
shouldThrow("MyObject.nullCall()");
shouldBe("derived.protoDup", 2);
shouldBe("derived.derivedOnly", 2)
+shouldBe("derived.baseHardNull()", undefined)
+
// base properties throw 1 when set; derived, 2
shouldBe("derived.baseDup = 0", 2);
shouldBe("derived.baseOnly = 0", 1);
for (var i = 0; i < 6; ++i)
var x = PropertyCatchalls.x;
shouldBe("x", null);
+var make_throw = 'make_throw';
+shouldThrow("PropertyCatchalls[make_throw]=1");
+make_throw = 0;
+shouldThrow("PropertyCatchalls[make_throw]=1");
for (var i = 0; i < 10; ++i) {
for (var p in PropertyCatchalls) {