OLD | NEW |
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 var windowProperties = Object.getOwnPropertyNames(window); | 5 var windowProperties = Object.getOwnPropertyNames(window); |
6 for (var i = 0; i < windowProperties.length; i++) { | 6 for (var i = 0; i < windowProperties.length; i++) { |
7 var name = windowProperties[i]; | 7 var name = windowProperties[i]; |
8 var value = window[name]; | 8 var value = window[name]; |
9 var re = new RegExp("Constructor]$"); | 9 var re = new RegExp("Constructor]$"); |
10 var isConstructor = re.exec(value); | 10 var isConstructor = re.exec(value); |
(...skipping 23 matching lines...) Expand all Loading... |
34 name == "Int8Array" || | 34 name == "Int8Array" || |
35 name == "Uint8Array" || | 35 name == "Uint8Array" || |
36 name == "Uint8ClampedArray" || | 36 name == "Uint8ClampedArray" || |
37 name == "Int16Array" || | 37 name == "Int16Array" || |
38 name == "Uint16Array" || | 38 name == "Uint16Array" || |
39 name == "Int32Array" || | 39 name == "Int32Array" || |
40 name == "Uint32Array" || | 40 name == "Uint32Array" || |
41 name == "Float32Array" || | 41 name == "Float32Array" || |
42 name == "Float64Array" || | 42 name == "Float64Array" || |
43 name == "FileError" || | 43 name == "FileError" || |
44 name == "FileReader" || | 44 name == "FileReader") |
45 name == "AutocompleteErrorEvent") | |
46 continue; | 45 continue; |
47 | 46 |
48 if (name == "XMLDocument") | 47 if (name == "XMLDocument") |
49 // Gecko exposes an "XMLDocument" constructor, but we just use Document
for XML documents instead of a custom sub-type | 48 // Gecko exposes an "XMLDocument" constructor, but we just use Document
for XML documents instead of a custom sub-type |
50 expectedConstructorName = "'function Document() { [native code] }'"; | 49 expectedConstructorName = "'function Document() { [native code] }'"; |
51 | 50 |
52 shouldBe("" + name + ".toString()", expectedConstructorName); | 51 shouldBe("" + name + ".toString()", expectedConstructorName); |
53 } | 52 } |
OLD | NEW |