From 88f94fa28c4bc7f8a0cd080943a8169098bb33b2 Mon Sep 17 00:00:00 2001 From: isaacs Date: Mon, 16 Apr 2012 21:27:12 -0700 Subject: [PATCH] MakeCallback: abort() if not a function --- src/node.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/node.cc b/src/node.cc index 26677eaeb6..818c1a46bc 100644 --- a/src/node.cc +++ b/src/node.cc @@ -991,9 +991,13 @@ MakeCallback(const Handle object, Local callback_v = object->Get(symbol); if (!callback_v->IsFunction()) { String::Utf8Value method(symbol); - fprintf(stderr, "method = %s", *method); + // XXX: If the object has a domain attached, handle it there? + // At least, would be good to get *some* sort of indication + // of how we got here, even if it's not catchable. + fprintf(stderr, "Non-function in MakeCallback. method = %s\n", *method); + abort(); } - assert(callback_v->IsFunction()); + Local callback = Local::Cast(callback_v); return scope.Close(MakeCallback(object, callback, argc, argv));