| 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 // clang-format off | 5 // clang-format off |
| 6 // Flags: --expose-wasm | 6 // Flags: --expose-wasm |
| 7 | 7 |
| 8 load("test/mjsunit/wasm/wasm-constants.js"); | 8 load("test/mjsunit/wasm/wasm-constants.js"); |
| 9 load("test/mjsunit/wasm/wasm-module-builder.js"); | 9 load("test/mjsunit/wasm/wasm-module-builder.js"); |
| 10 | 10 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 })(); | 99 })(); |
| 100 | 100 |
| 101 (function testWasmUnreachable() { | 101 (function testWasmUnreachable() { |
| 102 try { | 102 try { |
| 103 module.exports.exec_unreachable(); | 103 module.exports.exec_unreachable(); |
| 104 fail("expected wasm exception"); | 104 fail("expected wasm exception"); |
| 105 } catch (e) { | 105 } catch (e) { |
| 106 assertContains("unreachable", e.message); | 106 assertContains("unreachable", e.message); |
| 107 verifyStack(e.stack, [ | 107 verifyStack(e.stack, [ |
| 108 // isWasm function line pos file | 108 // isWasm function line pos file |
| 109 // TODO(clemensh): pos should be 1 | 109 [ true, "exec_unreachable", 1, 1, null], |
| 110 [ true, "exec_unreachable", 1, -1, null], | |
| 111 [ false, "testWasmUnreachable", 103, 0, "stack.js"], | 110 [ false, "testWasmUnreachable", 103, 0, "stack.js"], |
| 112 [ false, null, 115, 0, "stack.js"] | 111 [ false, null, 114, 0, "stack.js"] |
| 113 ]); | 112 ]); |
| 114 } | 113 } |
| 115 })(); | 114 })(); |
| 116 | 115 |
| 117 (function testWasmMemOutOfBounds() { | 116 (function testWasmMemOutOfBounds() { |
| 118 try { | 117 try { |
| 119 module.exports.call_mem_out_of_bounds(); | 118 module.exports.call_mem_out_of_bounds(); |
| 120 fail("expected wasm exception"); | 119 fail("expected wasm exception"); |
| 121 } catch (e) { | 120 } catch (e) { |
| 122 assertContains("out of bounds", e.message); | 121 assertContains("out of bounds", e.message); |
| 123 verifyStack(e.stack, [ | 122 verifyStack(e.stack, [ |
| 124 // isWasm function line pos file | 123 // isWasm function line pos file |
| 125 // TODO(clemensh): pos should be 3 | 124 [ true, "?", 2, 3, null], |
| 126 [ true, "?", 2, -1, null], | |
| 127 [ true, "call_mem_out_of_bounds", 3, 1, null], | 125 [ true, "call_mem_out_of_bounds", 3, 1, null], |
| 128 [ false, "testWasmMemOutOfBounds", 119, 0, "stack.js"], | 126 [ false, "testWasmMemOutOfBounds", 118, 0, "stack.js"], |
| 129 [ false, null, 132, 0, "stack.js"] | 127 [ false, null, 130, 0, "stack.js"] |
| 130 ]); | 128 ]); |
| 131 } | 129 } |
| 132 })(); | 130 })(); |
| OLD | NEW |