diff --git a/include/event-emitter.hpp b/include/event-emitter.hpp index e22a559..902c510 100644 --- a/include/event-emitter.hpp +++ b/include/event-emitter.hpp @@ -332,9 +332,11 @@ private: V8_VAR_STR code = JS_STR( "(new Error()).stack.split('\\n').slice(2).join('\\n')" ); - V8_VAR_STR stack = V8_VAR_STR::Cast( - v8::Script::Compile(code)->Run(Nan::GetCurrentContext()) - ); + + V8_VAR_STR stack = v8::Script::Compile(code)->Run( + Nan::GetCurrentContext() + ).As()->Value(); + Nan::Utf8String stackStr(stack); msg += *stackStr; @@ -437,9 +439,10 @@ private: }) )"); - V8_VAR_FUNC decor = V8_VAR_FUNC::Cast( - v8::Script::Compile(code)->Run(Nan::GetCurrentContext()) - ); + V8_VAR_FUNC decor = v8::Script::Compile(code)->Run( + Nan::GetCurrentContext() + ).As()->Value(); + Nan::Callback decorCb(decor); V8_VAR_VAL argv[] = { info.This(), info[0], raw }; Nan::AsyncResource async("EventEmitter::js_once()");