2 "This test checks that constructor properties are not enumeratable, but are writable deletable."
5 function canEnum(object
, propertyName
)
8 if (prop
== propertyName
)
13 function checkConstructor(expression
)
15 shouldBe(expression
+ ".hasOwnProperty('constructor')", "true");
16 shouldBe("canEnum(" + expression
+ ", 'constructor')", "false");
17 shouldBe("x = " + expression
+ "; x.constructor = 4; x.constructor", "4");
18 shouldBe("x = " + expression
+ "; delete x.constructor; x.hasOwnProperty('constructor')", "false");
21 checkConstructor("(function () { }).prototype");
22 function declaredFunction() { }
23 checkConstructor("declaredFunction.prototype");
24 checkConstructor("(new Function).prototype");
26 checkConstructor("Array.prototype");
27 checkConstructor("Boolean.prototype");
28 checkConstructor("Date.prototype");
29 checkConstructor("Error.prototype");
30 checkConstructor("EvalError.prototype");
31 checkConstructor("Function.prototype");
32 checkConstructor("Number.prototype");
33 checkConstructor("Object.prototype");
34 checkConstructor("RangeError.prototype");
35 checkConstructor("ReferenceError.prototype");
36 checkConstructor("RegExp.prototype");
37 checkConstructor("String.prototype");
38 checkConstructor("SyntaxError.prototype");
39 checkConstructor("TypeError.prototype");
40 checkConstructor("URIError.prototype");
42 checkConstructor("document.createTextNode('')");