| OLD | NEW |
| 1 description("Make sure prototypes are set up using the window a property came fr
om, instead of the lexical global object.") | 1 description("Make sure prototypes are set up using the window a property came fr
om, instead of the lexical global object.") |
| 2 | 2 |
| 3 var subframe = document.createElement("iframe"); | 3 var subframe = document.createElement("iframe"); |
| 4 document.body.appendChild(subframe); | 4 document.body.appendChild(subframe); |
| 5 var inner = subframe.contentWindow; // Call it "inner" to make shouldBe output s
horter | 5 var inner = subframe.contentWindow; // Call it "inner" to make shouldBe output s
horter |
| 6 | 6 |
| 7 // Stash a property on the prototypes. | 7 // Stash a property on the prototypes. |
| 8 window.Object.prototype.isInner = false; | 8 window.Object.prototype.isInner = false; |
| 9 inner.Object.prototype.isInner = true; | 9 inner.Object.prototype.isInner = true; |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 type == "ArrayBufferConstructor" || | 32 type == "ArrayBufferConstructor" || |
| 33 type =="Float32ArrayConstructor" || | 33 type =="Float32ArrayConstructor" || |
| 34 type =="Float64ArrayConstructor" || | 34 type =="Float64ArrayConstructor" || |
| 35 type =="Int8ArrayConstructor" || | 35 type =="Int8ArrayConstructor" || |
| 36 type =="Int16ArrayConstructor" || | 36 type =="Int16ArrayConstructor" || |
| 37 type =="Int32ArrayConstructor" || | 37 type =="Int32ArrayConstructor" || |
| 38 type =="Uint8ArrayConstructor" || | 38 type =="Uint8ArrayConstructor" || |
| 39 type =="Uint8ClampedArrayConstructor" || | 39 type =="Uint8ClampedArrayConstructor" || |
| 40 type =="Uint16ArrayConstructor" || | 40 type =="Uint16ArrayConstructor" || |
| 41 type =="Uint32ArrayConstructor" || | 41 type =="Uint32ArrayConstructor" || |
| 42 type == "FileErrorConstructor" || | |
| 43 type == "FileReaderConstructor" || | 42 type == "FileReaderConstructor" || |
| 44 type == "AudioContextConstructor" || | 43 type == "AudioContextConstructor" || |
| 45 type == "SpeechSynthesisUtteranceConstructor") | 44 type == "SpeechSynthesisUtteranceConstructor") |
| 46 continue; | 45 continue; |
| 47 if (!type.match('Constructor$')) | 46 if (!type.match('Constructor$')) |
| 48 continue; | 47 continue; |
| 49 constructorNames.push(property); | 48 constructorNames.push(property); |
| 50 } | 49 } |
| 51 return constructorNames.sort(); | 50 return constructorNames.sort(); |
| 52 } | 51 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 67 constructedObject = eval("new inner." + constructorName + argumentsStrin
g); | 66 constructedObject = eval("new inner." + constructorName + argumentsStrin
g); |
| 68 } catch(e) { | 67 } catch(e) { |
| 69 continue; | 68 continue; |
| 70 } | 69 } |
| 71 | 70 |
| 72 shouldBeTrue("(new inner." + constructorName + argumentsString + ").isInner"
); | 71 shouldBeTrue("(new inner." + constructorName + argumentsString + ").isInner"
); |
| 73 shouldBeTrue("(new inner." + constructorName + argumentsString + ").construc
tor.isInner"); | 72 shouldBeTrue("(new inner." + constructorName + argumentsString + ").construc
tor.isInner"); |
| 74 } | 73 } |
| 75 | 74 |
| 76 document.body.removeChild(subframe); | 75 document.body.removeChild(subframe); |
| OLD | NEW |