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

Side by Side Diff: test/mjsunit/asm/asm-validation.js

Issue 2568773002: [wasm][asm.js] Forbid function declaration replacing variable declaration. (Closed)
Patch Set: git cl try Created 4 years 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
« no previous file with comments | « test/cctest/asmjs/test-asm-typer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 })();
OLDNEW
« no previous file with comments | « test/cctest/asmjs/test-asm-typer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698