Loading editor/src/node_embedded.h +9 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,9 @@ public: v8::Isolate::Scope isolateScope(isolate); v8::HandleScope handleScope(isolate); v8::Context::Scope contextScope(context); node::async_context asyncContext{0, 0}; node::CallbackScope callbackScope(setup_->env(), context->Global(), asyncContext); v8::TryCatch tryCatch(isolate); auto fn = runFunction_.Get(isolate); v8::Local<v8::Value> argv[2] = { Loading @@ -120,7 +123,13 @@ public: }; if (fn->Call(context, context->Global(), 2, argv).IsEmpty()) { if (tryCatch.HasCaught()) { v8::String::Utf8Value exceptionUtf8(isolate, tryCatch.Exception()); const char *msg = *exceptionUtf8 ? *exceptionUtf8 : "unknown JS exception"; std::cerr << "Node embedded runtime error: run function call failed: " << msg << std::endl; } else { std::cerr << "Node embedded runtime error: run function call failed" << std::endl; } return 1; } Loading Loading
editor/src/node_embedded.h +9 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,9 @@ public: v8::Isolate::Scope isolateScope(isolate); v8::HandleScope handleScope(isolate); v8::Context::Scope contextScope(context); node::async_context asyncContext{0, 0}; node::CallbackScope callbackScope(setup_->env(), context->Global(), asyncContext); v8::TryCatch tryCatch(isolate); auto fn = runFunction_.Get(isolate); v8::Local<v8::Value> argv[2] = { Loading @@ -120,7 +123,13 @@ public: }; if (fn->Call(context, context->Global(), 2, argv).IsEmpty()) { if (tryCatch.HasCaught()) { v8::String::Utf8Value exceptionUtf8(isolate, tryCatch.Exception()); const char *msg = *exceptionUtf8 ? *exceptionUtf8 : "unknown JS exception"; std::cerr << "Node embedded runtime error: run function call failed: " << msg << std::endl; } else { std::cerr << "Node embedded runtime error: run function call failed" << std::endl; } return 1; } Loading