-
Notifications
You must be signed in to change notification settings - Fork 34
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
Consider "new.target" for constructor callbacks #200
Comments
Should this be added as an optional out parameter to |
@boingoing I don't think it should be added to |
This sounds like a good plan to me. Only constructors would be interested in this flag or new.target generally. |
Actually a callback is a constructor call if and only if a new target is defined. So I think we can just change |
That makes sense to me. |
Looks like related PR landed, closing. |
Reference nodejs/node#11975 (comment), nodejs/node#9293, nodejs/node#10915
In mixed JS/native inheritance scenarios, it can be necessary to get the "new target" for the constructor, via
v8::FunctionCallbackInfo<T>::NewTarget()
. In N-API this would be exposed asnapi_get_cb_new_target()
or something similar.The text was updated successfully, but these errors were encountered: