summaryrefslogtreecommitdiff
path: root/runtime/js/11_workers.js
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2023-05-01 22:30:02 +0900
committerGitHub <noreply@github.com>2023-05-01 15:30:02 +0200
commit6728ad4203d731e555dabf89ec6157f113454ce6 (patch)
tree956dc2d403b5a6ef107c35cab1ccc259ad4d86a1 /runtime/js/11_workers.js
parent94a148cdb6f7660518c75a3c20109bf64848f0f1 (diff)
fix(core): Use primordials for methods (#18839)
I would like to get this change into Deno before merging https://github.com/denoland/deno_lint/pull/1152
Diffstat (limited to 'runtime/js/11_workers.js')
-rw-r--r--runtime/js/11_workers.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/js/11_workers.js b/runtime/js/11_workers.js
index b08a5737e..e04690005 100644
--- a/runtime/js/11_workers.js
+++ b/runtime/js/11_workers.js
@@ -4,10 +4,11 @@ const core = globalThis.Deno.core;
const ops = core.ops;
const primordials = globalThis.__bootstrap.primordials;
const {
+ ArrayPrototypeFilter,
Error,
ObjectPrototypeIsPrototypeOf,
- StringPrototypeStartsWith,
String,
+ StringPrototypeStartsWith,
SymbolIterator,
SymbolToStringTag,
} = primordials;
@@ -192,8 +193,9 @@ class Worker extends EventTarget {
const event = new MessageEvent("message", {
cancelable: false,
data: message,
- ports: transferables.filter((t) =>
- ObjectPrototypeIsPrototypeOf(MessagePortPrototype, t)
+ ports: ArrayPrototypeFilter(
+ transferables,
+ (t) => ObjectPrototypeIsPrototypeOf(MessagePortPrototype, t),
),
});
this.dispatchEvent(event);