Browse Source

src: add IsFunction() assert to MakeCallback

Helps catch bugs early on. Without it, V8 throws the fairly
unhelpful exception "TypeError: undefined is not a function" -
unhelpful because there is no stack trace.
v0.11.5-release
Ben Noordhuis 12 years ago
parent
commit
db13983e68
  1. 1
      src/node.cc

1
src/node.cc

@ -1058,6 +1058,7 @@ MakeCallback(const Handle<Object> object,
HandleScope scope(node_isolate); HandleScope scope(node_isolate);
Local<Function> callback = object->Get(symbol).As<Function>(); Local<Function> callback = object->Get(symbol).As<Function>();
assert(callback->IsFunction());
if (using_domains) if (using_domains)
return scope.Close(MakeDomainCallback(object, callback, argc, argv)); return scope.Close(MakeDomainCallback(object, callback, argc, argv));

Loading…
Cancel
Save