summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2021-09-06 21:59:20 +0100
committerGitHub <noreply@github.com>2021-09-06 22:59:20 +0200
commitd331c4b283cf52614c519b1e9a3883e46dc25aab (patch)
tree0eb4546b57d14a9ba5efaed81f4dec0e4f7118d6 /cli
parent2c77681770dd8d0433ddbcb6f5a3329e235a664e (diff)
fix(ext/web): Format terminal DOMExceptions properly (#11834)
Diffstat (limited to 'cli')
-rw-r--r--cli/tests/integration/run_tests.rs7
-rw-r--r--cli/tests/testdata/dom_exception_formatting.ts1
-rw-r--r--cli/tests/testdata/dom_exception_formatting.ts.out2
3 files changed, 10 insertions, 0 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs
index 2c0a16582..4fd825507 100644
--- a/cli/tests/integration/run_tests.rs
+++ b/cli/tests/integration/run_tests.rs
@@ -1805,3 +1805,10 @@ itest!(byte_order_mark {
args: "run --no-check byte_order_mark.ts",
output: "byte_order_mark.out",
});
+
+// Regression test for https://github.com/denoland/deno/issues/11451.
+itest!(dom_exception_formatting {
+ args: "run dom_exception_formatting.ts",
+ output: "dom_exception_formatting.ts.out",
+ exit_code: 1,
+});
diff --git a/cli/tests/testdata/dom_exception_formatting.ts b/cli/tests/testdata/dom_exception_formatting.ts
new file mode 100644
index 000000000..0209ec81e
--- /dev/null
+++ b/cli/tests/testdata/dom_exception_formatting.ts
@@ -0,0 +1 @@
+throw new DOMException("foo", "SyntaxError");
diff --git a/cli/tests/testdata/dom_exception_formatting.ts.out b/cli/tests/testdata/dom_exception_formatting.ts.out
new file mode 100644
index 000000000..2a815eac1
--- /dev/null
+++ b/cli/tests/testdata/dom_exception_formatting.ts.out
@@ -0,0 +1,2 @@
+[WILDCARD]error: Uncaught SyntaxError: foo
+[WILDCARD]