diff options
author | 迷渡 <justjavac@gmail.com> | 2018-12-15 03:36:08 +0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-12-14 14:36:08 -0500 |
commit | 769994bd4ee352b636a6a5e58d346cf07539bfe6 (patch) | |
tree | 716d3b4219854a24c25d4b8f482dac544cc93e27 /js/console_test.ts | |
parent | 0bb43ebbfcbc378810f75c43a2be3369729921f7 (diff) |
`console.assert` should not throw error (#1335)
Diffstat (limited to 'js/console_test.ts')
-rw-r--r-- | js/console_test.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/js/console_test.ts b/js/console_test.ts index 578fb02b4..3e6bd6905 100644 --- a/js/console_test.ts +++ b/js/console_test.ts @@ -7,16 +7,17 @@ function stringify(...args: any[]): string { return stringifyArgs(args); } -test(function consoleTestAssert() { +test(function consoleTestAssertShouldNotThrowError() { console.assert(true); - let hasThrown = false; + let hasThrown = undefined; try { console.assert(false); + hasThrown = false; } catch { hasThrown = true; } - assertEqual(hasThrown, true); + assertEqual(hasThrown, false); }); test(function consoleTestStringifyComplexObjects() { |