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

Side by Side Diff: LayoutTests/fast/js/script-tests/global-constructors.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
1 description("This test documents our set of global constructors we expose on the window object (FF and Opera don't expose them on the window, btw). This also c hecks to make sure than any constructor attribute we expose has the expected con structor type.") 1 description("This test documents our set of global constructors we expose on the window object (FF and Opera don't expose them on the window, btw). This also c hecks to make sure than any constructor attribute we expose has the expected con structor type.")
2 2
3 var constructorNames = []; 3 var constructorNames = [];
4 4
5 for (var name in window) { 5 var windowProperties = Object.getOwnPropertyNames(window);
6 for (var i = 0; i < windowProperties.length; i++) {
7 var name = windowProperties[i];
6 var value = window[name]; 8 var value = window[name];
7 var re = new RegExp("Constructor]$"); 9 var re = new RegExp("Constructor]$");
8 var isConstructor = re.exec(value); 10 var isConstructor = re.exec(value);
9 if (isConstructor) 11 if (isConstructor)
10 constructorNames.push(name); 12 constructorNames.push(name);
11 } 13 }
12 14
13 constructorNames.sort(); 15 constructorNames.sort();
14 16
15 for (var x in constructorNames) { 17 for (var x in constructorNames) {
(...skipping 26 matching lines...) Expand all
42 name == "FileReader" || 44 name == "FileReader" ||
43 name == "AutocompleteErrorEvent") 45 name == "AutocompleteErrorEvent")
44 continue; 46 continue;
45 47
46 if (name == "XMLDocument") 48 if (name == "XMLDocument")
47 // Gecko exposes an "XMLDocument" constructor, but we just use Document for XML documents instead of a custom sub-type 49 // Gecko exposes an "XMLDocument" constructor, but we just use Document for XML documents instead of a custom sub-type
48 expectedConstructorName = "'[object DocumentConstructor]'"; 50 expectedConstructorName = "'[object DocumentConstructor]'";
49 51
50 shouldBe("" + name + ".toString()", expectedConstructorName); 52 shouldBe("" + name + ".toString()", expectedConstructorName);
51 } 53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698