mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
b6cdb31c05
PrismJS uses `WorkerGlobalScope` and `self` for detecting browser's Web
Worker context:
59e5a34713/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
7 lines
177 B
JavaScript
7 lines
177 B
JavaScript
if (typeof self !== "undefined") {
|
|
throw new Error("self is defined");
|
|
}
|
|
|
|
if (typeof WorkerGlobalScope !== "undefined") {
|
|
throw new Error("WorkerGlobalScope is defined");
|
|
}
|