summaryrefslogtreecommitdiff
path: root/runtime/js/99_main.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/99_main.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/99_main.js')
-rw-r--r--runtime/js/99_main.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index 01cf2973c..854a0029e 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -12,27 +12,28 @@ const ops = core.ops;
const internals = globalThis.__bootstrap.internals;
const primordials = globalThis.__bootstrap.primordials;
const {
+ ArrayPrototypeFilter,
ArrayPrototypeIndexOf,
+ ArrayPrototypeMap,
ArrayPrototypePush,
ArrayPrototypeShift,
ArrayPrototypeSplice,
- ArrayPrototypeMap,
DateNow,
Error,
ErrorPrototype,
- FunctionPrototypeCall,
FunctionPrototypeBind,
+ FunctionPrototypeCall,
ObjectAssign,
- ObjectDefineProperty,
ObjectDefineProperties,
+ ObjectDefineProperty,
ObjectFreeze,
ObjectPrototypeIsPrototypeOf,
ObjectSetPrototypeOf,
+ PromisePrototypeThen,
PromiseResolve,
+ SafeWeakMap,
Symbol,
SymbolIterator,
- PromisePrototypeThen,
- SafeWeakMap,
TypeError,
WeakMapPrototypeDelete,
WeakMapPrototypeGet,
@@ -147,8 +148,10 @@ async function pollForMessages() {
const msgEvent = new event.MessageEvent("message", {
cancelable: false,
data: message,
- ports: transferables.filter((t) =>
- ObjectPrototypeIsPrototypeOf(messagePort.MessagePortPrototype, t)
+ ports: ArrayPrototypeFilter(
+ transferables,
+ (t) =>
+ ObjectPrototypeIsPrototypeOf(messagePort.MessagePortPrototype, t),
),
});