Chromium Code Reviews| Index: test/mjsunit/wasm/wasm-constants.js |
| diff --git a/test/mjsunit/wasm/wasm-constants.js b/test/mjsunit/wasm/wasm-constants.js |
| index e4febc1e63f2a4e7296c3577166dc8b11c512ae9..903e650c4e7c02cb1e15ce49930bf78923c8683f 100644 |
| --- a/test/mjsunit/wasm/wasm-constants.js |
| +++ b/test/mjsunit/wasm/wasm-constants.js |
| @@ -373,3 +373,18 @@ function assertWasmThrows(value, code) { |
| } |
| throw new MjsUnitAssertionError("Did not throw at all, expected: " + value); |
| } |
| + |
| +function assertWasmError(code) { |
| + try { |
|
bradnelson
2016/10/17 22:13:25
Intent is weird here.
bradnelson
2016/10/17 22:23:26
Indent I mean
gdeepti
2016/10/18 02:34:17
Removed this function because assertThrows covers
|
| + if (typeof code === 'function') { |
| + code(); |
| + } else { |
| + eval(code); |
| + } |
| + } catch (e) { |
| + assertEquals("object", typeof e); |
| + // Success |
| + return; |
| + } |
| + throw new MjsUnitAssertionError("Did not throw, expected error"); |
| +} |