Browse Source

node: revert removal of MakeCallback

In 0168109 an implementation of MakeCallback was accidently removed. It
has been re-added.
v0.10.1-release
Trevor Norris 12 years ago
committed by Ben Noordhuis
parent
commit
a0867e1c93
  1. 34
      src/node.cc

34
src/node.cc

@ -904,6 +904,8 @@ MakeDomainCallback(const Handle<Object> object,
const Handle<Function> callback,
int argc,
Handle<Value> argv[]) {
// TODO Hook for long stack traces to be made here.
// lazy load _tickDomainCallback
if (process_tickDomainCallback.IsEmpty()) {
Local<Value> cb_v = process->Get(String::New("_tickDomainCallback"));
@ -980,20 +982,11 @@ MakeDomainCallback(const Handle<Object> object,
Handle<Value>
MakeCallback(const Handle<Object> object,
const Handle<String> symbol,
const Handle<Function> callback,
int argc,
Handle<Value> argv[]) {
HandleScope scope;
Local<Function> callback = object->Get(symbol).As<Function>();
Local<Value> domain = object->Get(domain_symbol);
// TODO Hook for long stack traces to be made here.
// has domain, off with you
if (!domain->IsNull() && !domain->IsUndefined())
return scope.Close(MakeDomainCallback(object, callback, argc, argv));
// lazy load no domain next tick callbacks
if (process_tickCallback.IsEmpty()) {
Local<Value> cb_v = process->Get(String::New("_tickCallback"));
@ -1017,7 +1010,7 @@ MakeCallback(const Handle<Object> object,
if (tick_infobox.length == 0) {
tick_infobox.index = 0;
tick_infobox.depth = 0;
return scope.Close(ret);
return ret;
}
// process nextTicks after call
@ -1028,7 +1021,24 @@ MakeCallback(const Handle<Object> object,
return Undefined();
}
return scope.Close(ret);
return ret;
}
Handle<Value>
MakeCallback(const Handle<Object> object,
const Handle<String> symbol,
int argc,
Handle<Value> argv[]) {
HandleScope scope;
Local<Function> callback = object->Get(symbol).As<Function>();
Local<Value> domain = object->Get(domain_symbol);
// has domain, off with you
if (!domain->IsNull() && !domain->IsUndefined())
return scope.Close(MakeDomainCallback(object, callback, argc, argv));
return scope.Close(MakeCallback(object, callback, argc, argv));
}

Loading…
Cancel
Save