Loading editor/src/node_embedded.h +3 −9 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ function getMod(scriptPath) { return { mod, p }; } globalThis.__blogiEmbeddedRun = async function(reqPath, resPath) { globalThis.__blogiEmbeddedRun = function(reqPath, resPath) { try { const req = JSON.parse(fs.readFileSync(reqPath, 'utf8')); const hook = (typeof req.hook === 'string' && req.hook) ? req.hook : 'render'; Loading @@ -60,7 +60,7 @@ globalThis.__blogiEmbeddedRun = async function(reqPath, resPath) { return true; } const result = await Promise.resolve(fn(req)); const result = fn(req); if (hook === 'metadata' && result && typeof result === 'object') { if (!result.type_id || typeof result.type_id !== 'string' || !result.type_id.trim()) { Loading Loading @@ -132,13 +132,7 @@ public: return 1; } auto loopResult = node::SpinEventLoop(setup_->env()); if (loopResult.IsNothing()) { std::cerr << "Node embedded runtime error: SpinEventLoop returned no exit code" << std::endl; return 1; } return loopResult.FromJust(); return 0; } private: Loading Loading
editor/src/node_embedded.h +3 −9 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ function getMod(scriptPath) { return { mod, p }; } globalThis.__blogiEmbeddedRun = async function(reqPath, resPath) { globalThis.__blogiEmbeddedRun = function(reqPath, resPath) { try { const req = JSON.parse(fs.readFileSync(reqPath, 'utf8')); const hook = (typeof req.hook === 'string' && req.hook) ? req.hook : 'render'; Loading @@ -60,7 +60,7 @@ globalThis.__blogiEmbeddedRun = async function(reqPath, resPath) { return true; } const result = await Promise.resolve(fn(req)); const result = fn(req); if (hook === 'metadata' && result && typeof result === 'object') { if (!result.type_id || typeof result.type_id !== 'string' || !result.type_id.trim()) { Loading Loading @@ -132,13 +132,7 @@ public: return 1; } auto loopResult = node::SpinEventLoop(setup_->env()); if (loopResult.IsNothing()) { std::cerr << "Node embedded runtime error: SpinEventLoop returned no exit code" << std::endl; return 1; } return loopResult.FromJust(); return 0; } private: Loading