Commit cc544ebe authored by jan.koester's avatar jan.koester
Browse files

test

parent 16445e3c
Loading
Loading
Loading
Loading
+19 −12
Original line number Diff line number Diff line
@@ -154,23 +154,30 @@ inline int runNodeRunnerInProcess(const std::string &reqPath,
    v8::HandleScope handleScope(setup->isolate());
    v8::Context::Scope contextScope(setup->context());

    bool runtimeOk = true;
    {
        v8::Locker locker(setup->isolate());
        v8::Isolate::Scope isolateScope(setup->isolate());
        v8::HandleScope handleScope(setup->isolate());
        v8::Context::Scope contextScope(setup->context());

        if (node::LoadEnvironment(setup->env(), bridgeScript).IsEmpty()) {
            std::cerr << "Node bridge runtime error: LoadEnvironment returned empty result" << std::endl;
        teardown();
        return 1;
    }

            runtimeOk = false;
        } else {
            auto loopResult = node::SpinEventLoop(setup->env());
            if (loopResult.IsNothing()) {
                std::cerr << "Node bridge runtime error: SpinEventLoop returned no exit code" << std::endl;
        teardown();
        return 1;
                runtimeOk = false;
            } else {
                rc = loopResult.FromJust();
            }
        }
    }

    rc = loopResult.FromJust();
    setup.reset();
    teardown();
    return rc;
    return runtimeOk ? rc : 1;
}

inline bool isBridgeRunnerInvocation(int argc, char *argv[]) {