From 769994bd4ee352b636a6a5e58d346cf07539bfe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BF=B7=E6=B8=A1?= Date: Sat, 15 Dec 2018 03:36:08 +0800 Subject: `console.assert` should not throw error (#1335) --- js/console_test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'js/console_test.ts') 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() { -- cgit v1.2.3