Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(743)

Side by Side Diff: LayoutTests/fast/js/script-tests/global-constructors-attributes.js

Issue 14447006: Global constructors should be configurable and not enumerable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 description("Test to ensure that global constructors have the right attributes") ;
2
3 function descriptorShouldBe(object, property, expected) {
4 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 '
5 if ("writable" in expected) {
6 // shouldBe(test+'.writable', '' + expected.writable);
7 shouldBe(test+'.value', '' + expected.value);
8 shouldBeFalse(test+".hasOwnProperty('get')");
9 shouldBeFalse(test+".hasOwnProperty('set')");
10 } else {
11 shouldBe(test+'.get', '' + expected.get);
12 shouldBe(test+'.set', '' + expected.set);
13 shouldBeFalse(test+".hasOwnProperty('value')");
14 shouldBeFalse(test+".hasOwnProperty('writable')");
15 }
16 shouldBe(test+'.enumerable', '' + expected.enumerable);
17 shouldBe(test+'.configurable', '' + expected.configurable);
18 }
19
20 var global = this;
21
22 descriptorShouldBe("global", "'CSSRuleList'", {writable: true, enumerable: false , configurable: true, value:"CSSRuleList"});
23 descriptorShouldBe("global", "'Document'", {writable: true, enumerable: false, c onfigurable: true, value:"Document"});
24 descriptorShouldBe("global", "'Element'", {writable: true, enumerable: false, co nfigurable: true, value:"Element"});
25 descriptorShouldBe("global", "'HTMLDivElement'", {writable: true, enumerable: fa lse, configurable: true, value:"HTMLDivElement"});
26 descriptorShouldBe("global", "'ProgressEvent'", {writable: true, enumerable: fal se, configurable: true, value:"ProgressEvent"});
27 descriptorShouldBe("global", "'Selection'", {writable: true, enumerable: false, configurable: true, value:"Selection"});
28 descriptorShouldBe("global", "'XMLHttpRequest'", {writable: true, enumerable: fa lse, configurable: true, value:"XMLHttpRequest"});
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698