-
Notifications
You must be signed in to change notification settings - Fork 505
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
Allow Value as target for function calls #499
Conversation
926b7ee
to
ba2bc34
Compare
, v8::Local<v8::String> symbol | ||
, int argc | ||
, v8::Local<v8::Value>* argv) { | ||
#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION | ||
v8::Local<v8::Object> target_ = target->IsUndefined() || target->IsNull() ? |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
The ternaries are making my eyeballs bleed but LGTM. |
Fixed the ugliness. Is this still good to go regarding MakeCallback? |
4cf1a68
to
5fcdc26
Compare
LGTM with the caveat that the handles from the Global() and ToObject() calls will leak into the handle scope of the caller. If that is bad, I'd add HandleScopes / EscapableHandleScopes. |
But, but... They should not be creating new handles... I'll add the scopes immediately. On October 22, 2015 11:21:59 PM GMT+03:00, Ben Noordhuis notifications@github.com wrote:
|
0f333b1
to
01448b4
Compare
That should do it. |
LGTM |
Thanks for taking the time to look through this. I'll flatten on merge. |
return New(node::MakeCallback( | ||
v8::Isolate::GetCurrent(), target, func, argc, argv)); | ||
if (target->IsUndefined() || target->IsNull()) { | ||
target_obj = isolate->GetCurrentContext()->Global(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Fixes #497
R: @bnoordhuis
Also, Node should be fixed to allow
v8::Value
innode::MakeCallback
.