Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ext/node/polyfills/_util/_util_callbackify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import { primordials } from "ext:core/mod.js";
const {
ArrayPrototypePop,
ReflectApply,
Error,
FunctionPrototypeApply,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add this primordial instead? I'm not sure how it works.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used ReflectApply instead

FunctionPrototypeBind,
ObjectDefineProperties,
ObjectGetOwnPropertyDescriptors,
Expand Down Expand Up @@ -112,10 +112,10 @@ function callbackify<ResultT>(
throw new NodeInvalidArgTypeError("last");
}
const cb = (...args: unknown[]) => {
FunctionPrototypeApply(maybeCb, this, args);
ReflectApply(maybeCb, this, args);
};
PromisePrototypeThen(
FunctionPrototypeApply(this, args),
ReflectApply(this, args),
(ret: unknown) => {
nextTick(FunctionPrototypeBind(cb, this, null, ret));
},
Expand Down