Try new Run

This commit is contained in:
Luis Blanco 2018-11-29 10:43:00 +03:00
parent 8e7a589bd8
commit 88ee8720d5
1 changed files with 6 additions and 2 deletions

View File

@ -332,7 +332,9 @@ private:
V8_VAR_STR code = JS_STR( V8_VAR_STR code = JS_STR(
"(new Error()).stack.split('\\n').slice(2).join('\\n')" "(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); Nan::Utf8String stackStr(stack);
msg += *stackStr; 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); Nan::Callback decorCb(decor);
V8_VAR_VAL argv[] = { info.This(), info[0], raw }; V8_VAR_VAL argv[] = { info.This(), info[0], raw };
Nan::AsyncResource async("EventEmitter::js_once()"); Nan::AsyncResource async("EventEmitter::js_once()");