fix(node): remove use of non existing FunctionPrototypeApply primordial (#21986)

Fixes #21978
This commit is contained in:
Divy Srivastava 2024-01-19 22:31:46 +05:30 committed by GitHub
parent 59f419bf41
commit 47232f8a41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,8 +26,8 @@
import { primordials } from "ext:core/mod.js"; import { primordials } from "ext:core/mod.js";
const { const {
ArrayPrototypePop, ArrayPrototypePop,
ReflectApply,
Error, Error,
FunctionPrototypeApply,
FunctionPrototypeBind, FunctionPrototypeBind,
ObjectDefineProperties, ObjectDefineProperties,
ObjectGetOwnPropertyDescriptors, ObjectGetOwnPropertyDescriptors,
@ -112,10 +112,10 @@ function callbackify<ResultT>(
throw new NodeInvalidArgTypeError("last"); throw new NodeInvalidArgTypeError("last");
} }
const cb = (...args: unknown[]) => { const cb = (...args: unknown[]) => {
FunctionPrototypeApply(maybeCb, this, args); ReflectApply(maybeCb, this, args);
}; };
PromisePrototypeThen( PromisePrototypeThen(
FunctionPrototypeApply(this, args), ReflectApply(this, args),
(ret: unknown) => { (ret: unknown) => {
nextTick(FunctionPrototypeBind(cb, this, null, ret)); nextTick(FunctionPrototypeBind(cb, this, null, ret));
}, },