diff --git a/include/event-emitter.hpp b/include/event-emitter.hpp index b33a7f2..e22a559 100644 --- a/include/event-emitter.hpp +++ b/include/event-emitter.hpp @@ -332,7 +332,9 @@ 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()); + V8_VAR_STR stack = V8_VAR_STR::Cast( + v8::Script::Compile(code)->Run(Nan::GetCurrentContext()) + ); Nan::Utf8String stackStr(stack); msg += *stackStr; @@ -435,7 +437,9 @@ private: }) )"); - V8_VAR_FUNC decor = V8_VAR_FUNC::Cast(v8::Script::Compile(code)->Run()); + V8_VAR_FUNC decor = V8_VAR_FUNC::Cast( + v8::Script::Compile(code)->Run(Nan::GetCurrentContext()) + ); Nan::Callback decorCb(decor); V8_VAR_VAL argv[] = { info.This(), info[0], raw }; Nan::AsyncResource async("EventEmitter::js_once()");