From 9314928990a6cbd0bc0abe3100872ba2682eda9a Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Wed, 6 Dec 2023 17:02:52 -0700 Subject: chore: bump deno_core and update tests (#21467) Landing changes required for https://github.com/denoland/deno_core/pull/359 We needed to update 99_main.js and a whole load of tests. API changes: - setPromiseRejectCallback becomes setUnhandledPromiseRejectionHandler. The function is now called from eventLoopTick. - The promiseRejectMacrotaskCallback no longer exists, as this is automatically handled in eventLoopTick. - ops.op_dispatch_exception now takes a second parameter: in_promise. The preferred way to call this op is now reportUnhandledException or reportUnhandledPromiseRejection. --- cli/tests/testdata/workers/close_nested_child.js | 1 + cli/tests/testdata/workers/error_event.ts.out | 4 ++-- cli/tests/testdata/workers/test.ts | 5 ++++- cli/tests/testdata/workers/worker_error.ts.out | 2 +- cli/tests/testdata/workers/worker_nested_error.ts.out | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) (limited to 'cli/tests/testdata/workers') diff --git a/cli/tests/testdata/workers/close_nested_child.js b/cli/tests/testdata/workers/close_nested_child.js index bd95ae08c..7c6ad603c 100644 --- a/cli/tests/testdata/workers/close_nested_child.js +++ b/cli/tests/testdata/workers/close_nested_child.js @@ -4,4 +4,5 @@ console.log("Starting the child worker"); setTimeout(() => { console.log("The child worker survived the death of the parent!!!"); + Deno.exit(1); }, 2000); diff --git a/cli/tests/testdata/workers/error_event.ts.out b/cli/tests/testdata/workers/error_event.ts.out index 9c075e23e..833cca8be 100644 --- a/cli/tests/testdata/workers/error_event.ts.out +++ b/cli/tests/testdata/workers/error_event.ts.out @@ -1,10 +1,10 @@ -error: Uncaught (in worker "") Error: foo +error: Uncaught (in worker "") (in promise) Error: foo throw new Error("foo"); ^ at foo ([WILDCARD]/error.ts:2:9) at [WILDCARD]/error.ts:5:1 { - message: "Uncaught Error: foo", + message: "Uncaught (in promise) Error: foo", filename: "[WILDCARD]/error.ts", lineno: 2, colno: 9 diff --git a/cli/tests/testdata/workers/test.ts b/cli/tests/testdata/workers/test.ts index 0f0a2e1c6..e052cf46b 100644 --- a/cli/tests/testdata/workers/test.ts +++ b/cli/tests/testdata/workers/test.ts @@ -94,7 +94,10 @@ Deno.test({ resolve(e.message); }; - assertMatch(await promise as string, /Uncaught Error: Thrown error/); + assertMatch( + await promise as string, + /Uncaught \(in promise\) Error: Thrown error/, + ); throwingWorker.terminate(); }, }); diff --git a/cli/tests/testdata/workers/worker_error.ts.out b/cli/tests/testdata/workers/worker_error.ts.out index 78d0c423e..1dd017770 100644 --- a/cli/tests/testdata/workers/worker_error.ts.out +++ b/cli/tests/testdata/workers/worker_error.ts.out @@ -1,4 +1,4 @@ -[WILDCARD]error: Uncaught (in worker "bar") Error: foo[WILDCARD] +[WILDCARD]error: Uncaught (in worker "bar") (in promise) Error: foo[WILDCARD] at foo ([WILDCARD]) at [WILDCARD] error: Uncaught (in promise) Error: Unhandled error in child worker. diff --git a/cli/tests/testdata/workers/worker_nested_error.ts.out b/cli/tests/testdata/workers/worker_nested_error.ts.out index 15cb85b48..3622acfb3 100644 --- a/cli/tests/testdata/workers/worker_nested_error.ts.out +++ b/cli/tests/testdata/workers/worker_nested_error.ts.out @@ -1,4 +1,4 @@ -[WILDCARD]error: Uncaught (in worker "bar") Error: foo[WILDCARD] +[WILDCARD]error: Uncaught (in worker "bar") (in promise) Error: foo[WILDCARD] throw new Error("foo"); ^ at foo ([WILDCARD]/workers/error.ts:[WILDCARD]) -- cgit v1.2.3