Commit 88183da0 authored by jan.koester's avatar jan.koester
Browse files

test

parent d51f8790
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -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] = {
@@ -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";
@@ -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()) {
+1 −1
Original line number Diff line number Diff line
@@ -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();
    }

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