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

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: Clean rebase on master 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 + " )";
5 if ("writable" in expected) {
6 shouldBe(test + ".value", "" + expected.value);
7 shouldBeFalse(test + ".hasOwnProperty('get')");
8 shouldBeFalse(test + ".hasOwnProperty('set')");
9 } else {
10 shouldBe(test + ".get", "" + expected.get);
11 shouldBe(test + ".set", "" + expected.set);
12 shouldBeFalse(test + ".hasOwnProperty('value')");
13 shouldBeFalse(test + ".hasOwnProperty('writable')");
14 }
15 shouldBe(test + ".enumerable", "" + expected.enumerable);
16 shouldBe(test + ".configurable", "" + expected.configurable);
17 }
18
19 var global = this;
20
21 descriptorShouldBe("global", "'CSSRuleList'", {writable: true, enumerable: false , configurable: true, value:"CSSRuleList"});
22 descriptorShouldBe("global", "'Document'", {writable: true, enumerable: false, c onfigurable: true, value:"Document"});
23 descriptorShouldBe("global", "'Element'", {writable: true, enumerable: false, co nfigurable: true, value:"Element"});
24 descriptorShouldBe("global", "'HTMLDivElement'", {writable: true, enumerable: fa lse, configurable: true, value:"HTMLDivElement"});
25 descriptorShouldBe("global", "'ProgressEvent'", {writable: true, enumerable: fal se, configurable: true, value:"ProgressEvent"});
26 descriptorShouldBe("global", "'Selection'", {writable: true, enumerable: false, configurable: true, value:"Selection"});
27 descriptorShouldBe("global", "'XMLHttpRequest'", {writable: true, enumerable: fa lse, configurable: true, value:"XMLHttpRequest"});
OLDNEW
« no previous file with comments | « LayoutTests/fast/js/script-tests/global-constructors.js ('k') | Source/bindings/scripts/CodeGeneratorV8.pm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698