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

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: 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("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
3 var constructorNames = [];
4
5 for (var name in window) {
6 var value = window[name];
7 var re = new RegExp("Constructor]$");
8 var isConstructor = re.exec(value);
9 if (isConstructor)
10 constructorNames.push(name);
11 }
12
13 constructorNames.sort();
14
15 for (var x in constructorNames) {
16 var name = constructorNames[x];
17 var expectedConstructorName = "'[object " + name + "Constructor]'";
18
19 // Ignore these properties because they do not exist in all implementations. They will be tested separately
20 if (name == "WebGLRenderingContext" ||
21 name == "WebGLActiveInfo" ||
22 name == "WebGLBuffer" ||
23 name == "WebGLFramebuffer" ||
24 name == "WebGLProgram" ||
25 name == "WebGLRenderbuffer" ||
26 name == "WebGLShader" ||
27 name == "WebGLShaderPrecisionFormat" ||
28 name == "WebGLTexture" ||
29 name == "WebGLUniformLocation" ||
30 name == "ArrayBuffer" ||
31 name == "DataView" ||
32 name == "Int8Array" ||
33 name == "Uint8Array" ||
34 name == "Uint8ClampedArray" ||
35 name == "Int16Array" ||
36 name == "Uint16Array" ||
37 name == "Int32Array" ||
38 name == "Uint32Array" ||
39 name == "Float32Array" ||
40 name == "Float64Array" ||
41 name == "FileError" ||
42 name == "FileReader" ||
43 name == "AutocompleteErrorEvent")
44 continue;
45
46 if (name == "XMLDocument")
47 // Gecko exposes an "XMLDocument" constructor, but we just use Document for XML documents instead of a custom sub-type
48 expectedConstructorName = "'[object DocumentConstructor]'";
49
50 shouldBe("" + name + ".toString()", expectedConstructorName);
51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698