Loading editor/src/node_embedded.h +3 −4 Original line number Diff line number Diff line Loading @@ -106,14 +106,13 @@ public: } auto *isolate = setup_->isolate(); auto context = setup_->context(); v8::Locker locker(isolate); v8::Isolate::Scope isolateScope(isolate); v8::HandleScope handleScope(isolate); auto context = setup_->context(); v8::Context::Scope contextScope(context); v8::TryCatch tryCatch(isolate); node::AsyncResource asyncResource(isolate, context->Global(), "blogi-editor-embedded"); auto fn = runFunction_.Get(isolate); v8::Local<v8::Value> argv[2] = { Loading @@ -121,7 +120,7 @@ public: v8::String::NewFromUtf8(isolate, resPath.c_str()).ToLocalChecked() }; if (asyncResource.MakeCallback(fn, 2, argv).IsEmpty()) { 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"; Loading Loading @@ -179,12 +178,12 @@ private: } auto *isolate = setup_->isolate(); auto context = setup_->context(); { v8::Locker locker(isolate); v8::Isolate::Scope isolateScope(isolate); v8::HandleScope handleScope(isolate); auto context = setup_->context(); v8::Context::Scope contextScope(context); if (node::LoadEnvironment(setup_->env(), kEmbeddedBootstrapScript).IsEmpty()) { Loading editor/widgets/nodewidget/nodewidget_adapter.h +1 −1 Original line number Diff line number Diff line Loading @@ -566,7 +566,7 @@ protected: static std::string makeTempPath(const std::string &name) { auto ts = std::chrono::high_resolution_clock::now().time_since_epoch().count(); std::ostringstream path; path << "/tmp/blogi_nodewidget_" << ts << "_" << name; path << "/var/lib/blogi-editor/blogi_nodewidget_" << ts << "_" << name; return path.str(); } Loading fake.js 0 → 100644 +1 −0 Original line number Diff line number Diff line module.exports = { render: function() { return 'hello'; } }; request.json 0 → 100644 +1 −0 Original line number Diff line number Diff line {"script_path": "./fake.js", "hook": "render"} response.json 0 → 100644 +1 −0 Original line number Diff line number Diff line {"status":"error","message":"No such built-in module: /home/intranet.tuxist.de/jan.koester/Projects/blogi/fake.js"} No newline at end of file Loading
editor/src/node_embedded.h +3 −4 Original line number Diff line number Diff line Loading @@ -106,14 +106,13 @@ public: } auto *isolate = setup_->isolate(); auto context = setup_->context(); v8::Locker locker(isolate); v8::Isolate::Scope isolateScope(isolate); v8::HandleScope handleScope(isolate); auto context = setup_->context(); v8::Context::Scope contextScope(context); v8::TryCatch tryCatch(isolate); node::AsyncResource asyncResource(isolate, context->Global(), "blogi-editor-embedded"); auto fn = runFunction_.Get(isolate); v8::Local<v8::Value> argv[2] = { Loading @@ -121,7 +120,7 @@ public: v8::String::NewFromUtf8(isolate, resPath.c_str()).ToLocalChecked() }; if (asyncResource.MakeCallback(fn, 2, argv).IsEmpty()) { 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"; Loading Loading @@ -179,12 +178,12 @@ private: } auto *isolate = setup_->isolate(); auto context = setup_->context(); { v8::Locker locker(isolate); v8::Isolate::Scope isolateScope(isolate); v8::HandleScope handleScope(isolate); auto context = setup_->context(); v8::Context::Scope contextScope(context); if (node::LoadEnvironment(setup_->env(), kEmbeddedBootstrapScript).IsEmpty()) { Loading
editor/widgets/nodewidget/nodewidget_adapter.h +1 −1 Original line number Diff line number Diff line Loading @@ -566,7 +566,7 @@ protected: static std::string makeTempPath(const std::string &name) { auto ts = std::chrono::high_resolution_clock::now().time_since_epoch().count(); std::ostringstream path; path << "/tmp/blogi_nodewidget_" << ts << "_" << name; path << "/var/lib/blogi-editor/blogi_nodewidget_" << ts << "_" << name; return path.str(); } Loading
fake.js 0 → 100644 +1 −0 Original line number Diff line number Diff line module.exports = { render: function() { return 'hello'; } };
request.json 0 → 100644 +1 −0 Original line number Diff line number Diff line {"script_path": "./fake.js", "hook": "render"}
response.json 0 → 100644 +1 −0 Original line number Diff line number Diff line {"status":"error","message":"No such built-in module: /home/intranet.tuxist.de/jan.koester/Projects/blogi/fake.js"} No newline at end of file