1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-18 03:44:05 -05:00

refactor(core): Overwrite ArrayPrototypeToString in primordials (#17470)

This commit is contained in:
Kenta Moriuchi 2023-01-20 01:22:18 +09:00 committed by GitHub
parent f85b006628
commit 023f028186
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -292,6 +292,7 @@
const { const {
ArrayPrototypeForEach, ArrayPrototypeForEach,
ArrayPrototypeJoin,
ArrayPrototypeMap, ArrayPrototypeMap,
FunctionPrototypeCall, FunctionPrototypeCall,
ObjectDefineProperty, ObjectDefineProperty,
@ -302,6 +303,7 @@
PromisePrototype, PromisePrototype,
PromisePrototypeThen, PromisePrototypeThen,
SymbolIterator, SymbolIterator,
TypedArrayPrototypeJoin,
} = primordials; } = primordials;
// Because these functions are used by `makeSafe`, which is exposed // Because these functions are used by `makeSafe`, which is exposed
@ -457,6 +459,12 @@
}, },
); );
primordials.ArrayPrototypeToString = (thisArray) =>
ArrayPrototypeJoin(thisArray);
primordials.TypedArrayPrototypeToString = (thisArray) =>
TypedArrayPrototypeJoin(thisArray);
primordials.PromisePrototypeCatch = (thisPromise, onRejected) => primordials.PromisePrototypeCatch = (thisPromise, onRejected) =>
PromisePrototypeThen(thisPromise, undefined, onRejected); PromisePrototypeThen(thisPromise, undefined, onRejected);