diff --git a/Cargo.lock b/Cargo.lock index e736e86ca6..67608b9bec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -982,9 +982,9 @@ dependencies = [ [[package]] name = "deno_core" -version = "0.198.0" +version = "0.199.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b34b6caa86eeea6f1449334c9ee26bec07e1db909bff5a4849727482cf06473" +checksum = "70fbd0cb620ac36fac08d708c5f01362280c5aa8149657a225db4932bd73758e" dependencies = [ "anyhow", "bytes", @@ -1354,9 +1354,9 @@ dependencies = [ [[package]] name = "deno_ops" -version = "0.76.0" +version = "0.77.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ca7df186f9f20d087a03d0ab314706bf5ffec1cf18c658efae833ce5dac3e8" +checksum = "8b345c096fd8433337ed8e1727f4732397c134e188e1739c88b0c077869020f3" dependencies = [ "deno-proc-macro-rules", "lazy-regex", @@ -1371,7 +1371,6 @@ dependencies = [ "syn 1.0.109", "syn 2.0.22", "thiserror", - "v8", ] [[package]] @@ -4457,9 +4456,9 @@ dependencies = [ [[package]] name = "serde_v8" -version = "0.109.0" +version = "0.110.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440a8a1f1cb9abe071937aa5190b0186fa6ce15ba0de5f88e57f71583e212b2c" +checksum = "b3bafaee0eecbef6c47ad3e7e0a764e22eb35a229ff7d06b7801fcbeaa5364b8" dependencies = [ "bytes", "derive_more", diff --git a/Cargo.toml b/Cargo.toml index 1b7a394f9b..ae8696b3af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,9 +41,9 @@ repository = "https://github.com/denoland/deno" v8 = { version = "0.74.1", default-features = false } deno_ast = { version = "0.27.0", features = ["transpiling"] } -deno_core = "0.198.0" -deno_ops = "0.76.0" -serde_v8 = "0.109.0" +deno_core = "0.199.0" +deno_ops = "0.77.0" +serde_v8 = "0.110.0" deno_runtime = { version = "0.121.0", path = "./runtime" } napi_sym = { version = "0.43.0", path = "./cli/napi/sym" } diff --git a/cli/tests/integration/worker_tests.rs b/cli/tests/integration/worker_tests.rs index 916e8c8874..aa6d64d2b8 100644 --- a/cli/tests/integration/worker_tests.rs +++ b/cli/tests/integration/worker_tests.rs @@ -108,3 +108,10 @@ itest!(worker_error_event { output: "workers/error_event.ts.out", exit_code: 1, }); + +// Regression test for https://github.com/denoland/deno/issues/19903 +itest!(worker_doest_stall_event_loop { + args: "run --quiet -A workers/worker_doest_stall_event_loop.ts", + output: "workers/worker_doest_stall_event_loop.ts.out", + exit_code: 0, +}); diff --git a/cli/tests/testdata/workers/worker_doest_stall_event_loop.ts b/cli/tests/testdata/workers/worker_doest_stall_event_loop.ts new file mode 100644 index 0000000000..bfddee2eca --- /dev/null +++ b/cli/tests/testdata/workers/worker_doest_stall_event_loop.ts @@ -0,0 +1,29 @@ +const moduleCode = ` +console.log('module start'); +const hash = await crypto.subtle.digest('SHA-1', new TextEncoder().encode('data')); +const __default = {}; +export { __default as default }; +console.log('module finish'); +`; + +const workerCode = ` + console.log('worker!'); + + globalThis.onmessage = (msg) => { + const { moduleCode } = msg.data; + (async () => { + console.log('before import'); + await import(URL.createObjectURL(new Blob([ moduleCode ]))); + console.log('after import'); + self.postMessage('thanks'); + })(); + } +`; +const worker = new Worker(URL.createObjectURL(new Blob([workerCode])), { + type: "module", +}); +worker.onmessage = () => { + console.log("worker.terminate"); + worker.terminate(); +}; +worker.postMessage({ moduleCode }); diff --git a/cli/tests/testdata/workers/worker_doest_stall_event_loop.ts.out b/cli/tests/testdata/workers/worker_doest_stall_event_loop.ts.out new file mode 100644 index 0000000000..5ed65b02f3 --- /dev/null +++ b/cli/tests/testdata/workers/worker_doest_stall_event_loop.ts.out @@ -0,0 +1,6 @@ +worker! +before import +module start +module finish +after import +worker.terminate