| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Flags: --validate-asm --allow-natives-syntax | 5 // Flags: --validate-asm --allow-natives-syntax |
| 6 | 6 |
| 7 // Note that this test file contains tests that explicitly check modules are | 7 // Note that this test file contains tests that explicitly check modules are |
| 8 // valid asm.js and then break them with invalid instantiation arguments. If | 8 // valid asm.js and then break them with invalid instantiation arguments. If |
| 9 // this script is run more than once (e.g. --stress-opt) then modules remain | 9 // this script is run more than once (e.g. --stress-opt) then modules remain |
| 10 // broken in the second run and assertions would fail. We prevent re-runs. | 10 // broken in the second run and assertions would fail. We prevent re-runs. |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 return 43; | 356 return 43; |
| 357 } | 357 } |
| 358 return 0; | 358 return 0; |
| 359 } | 359 } |
| 360 return { foo: foo }; | 360 return { foo: foo }; |
| 361 } | 361 } |
| 362 var m = Module(); | 362 var m = Module(); |
| 363 assertFalse(%IsAsmWasmCode(Module)); | 363 assertFalse(%IsAsmWasmCode(Module)); |
| 364 assertEquals(43, m.foo(3)); | 364 assertEquals(43, m.foo(3)); |
| 365 })(); | 365 })(); |
| 366 |
| 367 (function TestVarHidesExport() { |
| 368 function Module() { |
| 369 "use asm"; |
| 370 var foo; |
| 371 function foo() {} |
| 372 return foo; |
| 373 } |
| 374 Module(); |
| 375 assertFalse(%IsAsmWasmCode(Module)); |
| 376 })(); |
| OLD | NEW |