summaryrefslogtreecommitdiff
path: root/tests/specs/npm/workers/main.ts
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2024-08-17 11:16:43 +0900
committerGitHub <noreply@github.com>2024-08-17 11:16:43 +0900
commitb6cdb31c0591ffd4dd9fee7a44554f5d915ba58e (patch)
treeb815eb1d3c847b1a57b04631c6e6dc246baaffaa /tests/specs/npm/workers/main.ts
parent2eeea0a1d2011567d3a41065d66802097366dc8c (diff)
fix(ext/node): fix prismjs compatibiliy in Web Worker (#25062)
PrismJS uses `WorkerGlobalScope` and `self` for detecting browser's Web Worker context: https://github.com/PrismJS/prism/blob/59e5a3471377057de1f401ba38337aca27b80e03/prism.js#L11 Now the detection logic above is broken when it's imported from Deno's Web Worker context because we only hide `self` (Prism assumes when `WorkerGlobalScope` is available, `self` is also available). This change fixes the above by also hiding `WorkerGlobalScope` global in Node compat mode. closes #25008
Diffstat (limited to 'tests/specs/npm/workers/main.ts')
-rw-r--r--tests/specs/npm/workers/main.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/specs/npm/workers/main.ts b/tests/specs/npm/workers/main.ts
index f51cf4d90..575580790 100644
--- a/tests/specs/npm/workers/main.ts
+++ b/tests/specs/npm/workers/main.ts
@@ -7,3 +7,6 @@ new Worker(new URL("./worker2.ts", import.meta.url), {
new Worker(new URL("./worker3.ts", import.meta.url), {
type: "module",
});
+new Worker(new URL("./worker4.ts", import.meta.url), {
+ type: "module",
+});