summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2021-01-21 09:48:04 +0000
committerGitHub <noreply@github.com>2021-01-21 20:48:04 +1100
commitbdb1ee64800e03699d41265c5158c99e3a390ec7 (patch)
tree28fdf0820530f447167cdad230d72c2b43d18541 /cli/tests
parent18ac7d40c87b380ce5ed617bd7c59e344730a883 (diff)
fix(core): Handle prepareStackTrace() throws (#9211)
Fixes #9206
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/082_prepare_stack_trace_throw.js6
-rw-r--r--cli/tests/082_prepare_stack_trace_throw.js.out2
-rw-r--r--cli/tests/integration_tests.rs6
3 files changed, 14 insertions, 0 deletions
diff --git a/cli/tests/082_prepare_stack_trace_throw.js b/cli/tests/082_prepare_stack_trace_throw.js
new file mode 100644
index 000000000..8137bfdc8
--- /dev/null
+++ b/cli/tests/082_prepare_stack_trace_throw.js
@@ -0,0 +1,6 @@
+Error.prepareStackTrace = () => {
+ console.trace();
+ throw new Error("foo");
+};
+
+new Error("bar").stack;
diff --git a/cli/tests/082_prepare_stack_trace_throw.js.out b/cli/tests/082_prepare_stack_trace_throw.js.out
new file mode 100644
index 000000000..751b7c971
--- /dev/null
+++ b/cli/tests/082_prepare_stack_trace_throw.js.out
@@ -0,0 +1,2 @@
+[WILDCARD]error: Uncaught Error: foo
+[WILDCARD]
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index 428d1ff30..16d3a210c 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -2685,6 +2685,12 @@ itest!(_081_location_relative_fetch_redirect {
http_server: true,
});
+itest!(_082_prepare_stack_trace_throw {
+ args: "run 082_prepare_stack_trace_throw.js",
+ output: "082_prepare_stack_trace_throw.js.out",
+ exit_code: 1,
+});
+
itest!(js_import_detect {
args: "run --quiet --reload js_import_detect.ts",
output: "js_import_detect.ts.out",