| OLD | NEW |
| 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 load("test/mjsunit/wasm/wasm-constants.js"); | 7 load("test/mjsunit/wasm/wasm-constants.js"); |
| 8 | 8 |
| 9 try { | 9 try { |
| 10 var data = bytes( | 10 var data = bytes( |
| 11 0, kAstStmt, // signature | 11 0, kAstStmt, // signature |
| 12 3, 0, // local int32 count | 12 3, 0, // local int32 count |
| 13 4, 0, // local int64 count | 13 4, 0, // local int64 count |
| 14 5, 0, // local float32 count | 14 5, 0, // local float32 count |
| 15 6, 0, // local float64 count | 15 6, 0, // local float64 count |
| 16 kExprNop // body | 16 kExprNop // body |
| 17 ); | 17 ); |
| 18 | 18 |
| 19 WASM.verifyFunction(data); | 19 _WASMEXP_.verifyFunction(data); |
| 20 print("ok"); | 20 print("ok"); |
| 21 } catch (e) { | 21 } catch (e) { |
| 22 assertTrue(false); | 22 assertTrue(false); |
| 23 } | 23 } |
| 24 | 24 |
| 25 | 25 |
| 26 var threw = false; | 26 var threw = false; |
| 27 try { | 27 try { |
| 28 var data = bytes( | 28 var data = bytes( |
| 29 0, kAstI32, // signature | 29 0, kAstI32, // signature |
| 30 2, 0, // local int32 count | 30 2, 0, // local int32 count |
| 31 3, 0, // local int64 count | 31 3, 0, // local int64 count |
| 32 4, 0, // local float32 count | 32 4, 0, // local float32 count |
| 33 5, 0, // local float64 count | 33 5, 0, // local float64 count |
| 34 kExprBlock, 2, kExprNop, kExprNop // body | 34 kExprBlock, 2, kExprNop, kExprNop // body |
| 35 ); | 35 ); |
| 36 | 36 |
| 37 WASM.verifyFunction(data); | 37 _WASMEXP_.verifyFunction(data); |
| 38 print("not ok"); | 38 print("not ok"); |
| 39 } catch (e) { | 39 } catch (e) { |
| 40 print("ok: " + e); | 40 print("ok: " + e); |
| 41 threw = true; | 41 threw = true; |
| 42 } | 42 } |
| 43 | 43 |
| 44 assertTrue(threw); | 44 assertTrue(threw); |
| OLD | NEW |