From 9326d5a0c2d5076ef6d66ee0110eb825aacdc76a Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 13 Jan 2021 19:20:28 +0900 Subject: [PATCH] test: fix test case 070_location --- cli/tests/070_location.ts | 2 +- op_crates/web/00_dom_exception.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/tests/070_location.ts b/cli/tests/070_location.ts index 62fd34af2808b7..4eace257e265f6 100644 --- a/cli/tests/070_location.ts +++ b/cli/tests/070_location.ts @@ -6,5 +6,5 @@ console.log(location); try { location.hostname = "bar"; } catch (error) { - console.log(error); + console.log(error.toString()); } diff --git a/op_crates/web/00_dom_exception.js b/op_crates/web/00_dom_exception.js index 47ee1fdbd71157..d851062ce5a955 100644 --- a/op_crates/web/00_dom_exception.js +++ b/op_crates/web/00_dom_exception.js @@ -68,7 +68,7 @@ this.#message = String(message); this.#name = name; this.#code = nameToCodeMapping[name] ?? 0; - this.stack = new Error().stack.replace(/^Error/, "DOMException"); + this.stack = new Error().stack.replace(/^Error/, this.#message ? `DOMException: ${this.#message}` : 'DOMException'); } get message() {