mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 19:08:15 +00:00
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
This commit is contained in:
parent
94a148cdb6
commit
6728ad4203
17 changed files with 378 additions and 270 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue