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

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

Issue 2109533002: [wasm] Require wasm explicit asm instantiation to be of a function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months 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/mjsunit/regress/regress-wasm-crbug-620649.js ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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: --expose-wasm 5 // Flags: --expose-wasm
6 6
7 function assertWasm(expected, func, ffi) { 7 function assertWasm(expected, func, ffi) {
8 print("Testing " + func.name + "..."); 8 print("Testing " + func.name + "...");
9 assertEquals(expected, Wasm.instantiateModuleFromAsm( 9 assertEquals(expected, Wasm.instantiateModuleFromAsm(
10 func.toString(), ffi).caller()); 10 func.toString(), ffi).caller());
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1523 u0xffffffff: u0xffffffff, 1523 u0xffffffff: u0xffffffff,
1524 u0x80000000: u0x80000000, 1524 u0x80000000: u0x80000000,
1525 u0x87654321: u0x87654321, 1525 u0x87654321: u0x87654321,
1526 }; 1526 };
1527 } 1527 }
1528 var wasm = Wasm.instantiateModuleFromAsm(asmModule.toString()); 1528 var wasm = Wasm.instantiateModuleFromAsm(asmModule.toString());
1529 assertEquals(0xffffffff, wasm.u0xffffffff()); 1529 assertEquals(0xffffffff, wasm.u0xffffffff());
1530 assertEquals(0x80000000, wasm.u0x80000000()); 1530 assertEquals(0x80000000, wasm.u0x80000000());
1531 assertEquals(0x87654321, wasm.u0x87654321()); 1531 assertEquals(0x87654321, wasm.u0x87654321());
1532 })(); 1532 })();
1533
1534 (function TestBadNoDeclaration() {
1535 assertThrows(function() {
1536 Wasm.instantiateModuleFromAsm('33;');
1537 });
1538 })();
1539
1540 (function TestBadVarDeclaration() {
1541 assertThrows(function() {
1542 Wasm.instantiateModuleFromAsm('var x = 3;');
1543 });
1544 })();
OLDNEW
« no previous file with comments | « test/mjsunit/regress/regress-wasm-crbug-620649.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698