Chromium Code Reviews| 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 function bytes() { | 7 function bytes() { |
| 8 var buffer = new ArrayBuffer(arguments.length); | 8 var buffer = new ArrayBuffer(arguments.length); |
| 9 var view = new Uint8Array(buffer); | 9 var view = new Uint8Array(buffer); |
| 10 for (var i = 0; i < arguments.length; i++) { | 10 for (var i = 0; i < arguments.length; i++) { |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 366 eval(code); | 366 eval(code); |
| 367 } | 367 } |
| 368 } catch (e) { | 368 } catch (e) { |
| 369 assertEquals("number", typeof e); | 369 assertEquals("number", typeof e); |
| 370 assertEquals(value, e); | 370 assertEquals(value, e); |
| 371 // Success. | 371 // Success. |
| 372 return; | 372 return; |
| 373 } | 373 } |
| 374 throw new MjsUnitAssertionError("Did not throw at all, expected: " + value); | 374 throw new MjsUnitAssertionError("Did not throw at all, expected: " + value); |
| 375 } | 375 } |
| 376 | |
| 377 function assertWasmError(code) { | |
| 378 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
| |
| 379 if (typeof code === 'function') { | |
| 380 code(); | |
| 381 } else { | |
| 382 eval(code); | |
| 383 } | |
| 384 } catch (e) { | |
| 385 assertEquals("object", typeof e); | |
| 386 // Success | |
| 387 return; | |
| 388 } | |
| 389 throw new MjsUnitAssertionError("Did not throw, expected error"); | |
| 390 } | |
| OLD | NEW |