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 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 Loading... |
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 } |
OLD | NEW |