Index: LayoutTests/fast/js/script-tests/global-constructors-attributes.js |
diff --git a/LayoutTests/fast/js/script-tests/global-constructors-attributes.js b/LayoutTests/fast/js/script-tests/global-constructors-attributes.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8a1b19d38e9ef05a5dfe440f6f4cc73e37c7b2e7 |
--- /dev/null |
+++ b/LayoutTests/fast/js/script-tests/global-constructors-attributes.js |
@@ -0,0 +1,28 @@ |
+description("Test to ensure that global constructors have the right attributes"); |
+ |
+function descriptorShouldBe(object, property, expected) { |
+ var test = 'Object.getOwnPropertyDescriptor('+object+", "+property+')'; |
arv (Not doing code reviews)
2013/04/24 15:34:08
whitespace around binops
arv (Not doing code reviews)
2013/04/24 15:34:08
Stick to either " or '
|
+ if ("writable" in expected) { |
+ // shouldBe(test+'.writable', '' + expected.writable); |
+ shouldBe(test+'.value', '' + expected.value); |
+ shouldBeFalse(test+".hasOwnProperty('get')"); |
+ shouldBeFalse(test+".hasOwnProperty('set')"); |
+ } else { |
+ shouldBe(test+'.get', '' + expected.get); |
+ shouldBe(test+'.set', '' + expected.set); |
+ shouldBeFalse(test+".hasOwnProperty('value')"); |
+ shouldBeFalse(test+".hasOwnProperty('writable')"); |
+ } |
+ shouldBe(test+'.enumerable', '' + expected.enumerable); |
+ shouldBe(test+'.configurable', '' + expected.configurable); |
+} |
+ |
+var global = this; |
+ |
+descriptorShouldBe("global", "'CSSRuleList'", {writable: true, enumerable: false, configurable: true, value:"CSSRuleList"}); |
+descriptorShouldBe("global", "'Document'", {writable: true, enumerable: false, configurable: true, value:"Document"}); |
+descriptorShouldBe("global", "'Element'", {writable: true, enumerable: false, configurable: true, value:"Element"}); |
+descriptorShouldBe("global", "'HTMLDivElement'", {writable: true, enumerable: false, configurable: true, value:"HTMLDivElement"}); |
+descriptorShouldBe("global", "'ProgressEvent'", {writable: true, enumerable: false, configurable: true, value:"ProgressEvent"}); |
+descriptorShouldBe("global", "'Selection'", {writable: true, enumerable: false, configurable: true, value:"Selection"}); |
+descriptorShouldBe("global", "'XMLHttpRequest'", {writable: true, enumerable: false, configurable: true, value:"XMLHttpRequest"}); |