-
Notifications
You must be signed in to change notification settings - Fork 506
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
Receiver parameter for CallAsFunction should be Local<Value> #497
Comments
On October 21, 2015 9:47:07 AM GMT+03:00, "C. Scott Ananian" notifications@github.com wrote:
|
Hm. JavaScript has changed since the node 0.8.x days. |
Try telling that to the holdouts who refuse to upgrade. Here I am, seemingly stuck with supporting outdated software until the heat death of the universe. The same goes for 0.10. |
It would be possible to emulate it for older versions with something like this: Local<Value> recv = /* ... */;
Local<Object> recv_obj;
if (recv->IsUndefined() || recv->IsNull()) {
recv_obj = Context::Global();
} else {
recv_obj = recv->ToObject();
} The IsUndefined() and IsNull() checks are cheap, probably cheaper than putting in an extra |
Interesting. Would this apply to all the other function-related stuff which has On Wednesday 21 October 2015 02:47:00 Ben Noordhuis wrote:
|
What function-related stuff is that? My comment was mostly in the context of Function::Call(). |
I seem to remember a couple other places where there has been a change from Object to Value. Some in V8 some in Node. Maybe MakeCallback? I think there was a bunch of stuff that eventually boiled down to Function::Call. On October 21, 2015 12:58:33 PM GMT+03:00, Ben Noordhuis notifications@github.com wrote:
|
Oh, like that. Yes, for consistency the nan wrapper for node::MakeCallback() should get the same treatment. |
After grepping for |
It would be nice to ensure that |
|
It does (or should - like @kkoopa said, it's a V8 bug if it doesn't.) |
Could not come up with a way to handle the differences between strict and sloppy mode correctly, so this cannot be done until 0.10 support is dropped. |
The receiver can be null, so the receiver parameter for
Nan::CallAsFunction
should beLocal<Value>
notLocal<Object>
. The parameter is declared asLocal<Value>
in v8, it's just Nan which has the overly-restrictive type.The text was updated successfully, but these errors were encountered: