diff options
Diffstat (limited to 'worker/php/exec.mjs')
| -rw-r--r-- | worker/php/exec.mjs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/worker/php/exec.mjs b/worker/php/exec.mjs index 7403dfc..f1cb361 100644 --- a/worker/php/exec.mjs +++ b/worker/php/exec.mjs @@ -2,22 +2,22 @@ import { buildResult, createIOCallbacks, preprocessCode } from "./lib.mjs"; import PHPWasm from "./php-wasm.js"; process.once("message", async ({ code: originalCode, input }) => { - const code = preprocessCode(originalCode); - const io = createIOCallbacks(input); + const code = preprocessCode(originalCode); + const io = createIOCallbacks(input); - const { ccall } = await PHPWasm({ - stdin: io.stdin, - stdout: io.stdout, - stderr: io.stderr, - }); + const { ccall } = await PHPWasm({ + stdin: io.stdin, + stdout: io.stdout, + stderr: io.stderr, + }); - let err; - let result; - try { - result = ccall("php_wasm_run", "number", ["string"], [code]); - } catch (e) { - err = e; - } + let err; + let result; + try { + result = ccall("php_wasm_run", "number", ["string"], [code]); + } catch (e) { + err = e; + } - process.send(buildResult(err, result, io.getStdout, io.getStderr)); + process.send(buildResult(err, result, io.getStdout, io.getStderr)); }); |
