summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2022-08-21 12:57:10 +0100
committerGitHub <noreply@github.com>2022-08-21 13:57:10 +0200
commite39d4e3e7fb9815bf094e7321d1d73d00275831a (patch)
tree4eb2c43dd74ecbe5f15ea1783045ec47288d1f7d /cli
parent3caec9721e094858411cf5452db76c4aea390625 (diff)
fix(core/runtime): always cancel termination in exception handling (#15514)
Diffstat (limited to 'cli')
-rw-r--r--cli/tests/integration/run_tests.rs7
-rw-r--r--cli/tests/testdata/report_error_end_of_program.ts1
-rw-r--r--cli/tests/testdata/report_error_end_of_program.ts.out4
3 files changed, 12 insertions, 0 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs
index adaa6d49d..9c60cc745 100644
--- a/cli/tests/integration/run_tests.rs
+++ b/cli/tests/integration/run_tests.rs
@@ -2738,6 +2738,13 @@ itest!(report_error_handled {
output: "report_error_handled.ts.out",
});
+// Regression test for https://github.com/denoland/deno/issues/15513.
+itest!(report_error_end_of_program {
+ args: "run --quiet report_error_end_of_program.ts",
+ output: "report_error_end_of_program.ts.out",
+ exit_code: 1,
+});
+
itest!(spawn_stdout_inherit {
args: "run --quiet --unstable -A spawn_stdout_inherit.ts",
output: "spawn_stdout_inherit.ts.out",
diff --git a/cli/tests/testdata/report_error_end_of_program.ts b/cli/tests/testdata/report_error_end_of_program.ts
new file mode 100644
index 000000000..cd7ce7f9c
--- /dev/null
+++ b/cli/tests/testdata/report_error_end_of_program.ts
@@ -0,0 +1 @@
+reportError(new Error("foo"));
diff --git a/cli/tests/testdata/report_error_end_of_program.ts.out b/cli/tests/testdata/report_error_end_of_program.ts.out
new file mode 100644
index 000000000..ecca63389
--- /dev/null
+++ b/cli/tests/testdata/report_error_end_of_program.ts.out
@@ -0,0 +1,4 @@
+error: Uncaught Error: foo
+reportError(new Error("foo"));
+ ^
+ at [WILDCARD]/report_error_end_of_program.ts:1:13