diff --git a/src/node.cc b/src/node.cc index 7b1d8439e96..1d2f9055668 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1087,6 +1087,23 @@ MakeCallback(const Handle object, } +// Internal only. +Handle +MakeCallback(const Handle object, + uint32_t index, + int argc, + Handle argv[]) { + HandleScope scope(node_isolate); + + Local callback = object->Get(index).As(); + assert(callback->IsFunction()); + + if (using_domains) + return scope.Close(MakeDomainCallback(object, callback, argc, argv)); + return scope.Close(MakeCallback(object, callback, argc, argv)); +} + + Handle MakeCallback(const Handle object, const Handle symbol, diff --git a/src/node_internals.h b/src/node_internals.h index 5e7e65cb06b..ba110a51c84 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -76,6 +76,12 @@ inline v8::Local PersistentToLocal( v8::Isolate* isolate, const v8::Persistent& persistent); +v8::Handle MakeCallback( + const v8::Handle recv, + uint32_t index, + int argc, + v8::Handle* argv); + template v8::Handle MakeCallback( const v8::Persistent& recv,