diff options
author | Alon Zakai <azakai@mozilla.com> | 2010-12-23 16:44:30 -0800 |
---|---|---|
committer | Alon Zakai <azakai@mozilla.com> | 2010-12-23 16:44:30 -0800 |
commit | 7985433ea6d2beb324f8ae7cd653407376955555 (patch) | |
tree | 9c2a1c9b8cc0afa708c58c86421d9ac8c2b36ef8 /src/utility.js | |
parent | 694281c58089db051c25f2b5dc94ed7c779a166f (diff) |
error message when encountering asm calls
Diffstat (limited to 'src/utility.js')
-rw-r--r-- | src/utility.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/utility.js b/src/utility.js index ec4bf99b..ce726fbe 100644 --- a/src/utility.js +++ b/src/utility.js @@ -46,13 +46,18 @@ function dumpKeys(item) { function assertEq(a, b) { if (a !== b) { - print("Stack: " + new Error().stack); - throw "Should have been equal: " + a + " : " + b; + print('Stack: ' + new Error().stack); + throw 'Should have been equal: ' + a + ' : ' + b; } } -function assertTrue(a) { - assertEq(!!a, true); +function assertTrue(a, msg) { + if (!a) { + msg = 'Assertion failed: ' + msg; + print(msg); + print('Stack: ' + new Error().stack); + throw msg; + } } assert = assertTrue; |