From 4e3532fe7b61a1050b00611081cc83af8b02de70 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Sun, 19 Apr 2020 14:17:22 +0100 Subject: fix(core/js_errors): Get error's name and message from JS fields (#4808) --- cli/tests/error_022_stack_custom_error.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'cli/tests/error_022_stack_custom_error.ts') diff --git a/cli/tests/error_022_stack_custom_error.ts b/cli/tests/error_022_stack_custom_error.ts index 6f3c1b0bd..b95743503 100644 --- a/cli/tests/error_022_stack_custom_error.ts +++ b/cli/tests/error_022_stack_custom_error.ts @@ -1,10 +1,14 @@ class CustomError extends Error { - constructor(message: string) { - super(message); + constructor() { + super(); this.name = "CustomError"; } + + get message(): string { + return "custom error"; + } } -const error = new CustomError("custom error"); +const error = new CustomError(); console.log(error.stack); throw error; -- cgit v1.2.3