From 2aed322dd507a8568b6ee6f4897e9a8e3220f763 Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Mon, 5 Apr 2021 18:40:24 +0200 Subject: refactor: convert ops to use serde_v8 (#10009) This commit rewrites most of the ops to use "serde_v8" instead of "json" serialization. --- runtime/js/40_signals.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'runtime/js/40_signals.js') diff --git a/runtime/js/40_signals.js b/runtime/js/40_signals.js index 2a70986f8..e222a9199 100644 --- a/runtime/js/40_signals.js +++ b/runtime/js/40_signals.js @@ -7,15 +7,15 @@ const { errors } = window.__bootstrap.errors; function bindSignal(signo) { - return core.jsonOpSync("op_signal_bind", { signo }); + return core.jsonOpSync("op_signal_bind", signo); } function pollSignal(rid) { - return core.jsonOpAsync("op_signal_poll", { rid }); + return core.jsonOpAsync("op_signal_poll", rid); } function unbindSignal(rid) { - core.jsonOpSync("op_signal_unbind", { rid }); + core.jsonOpSync("op_signal_unbind", rid); } // From `kill -l` @@ -209,21 +209,21 @@ #rid = 0; constructor(signo) { - this.#rid = bindSignal(signo).rid; + this.#rid = bindSignal(signo); this.#loop(); } #pollSignal = async () => { - let res; + let done; try { - res = await pollSignal(this.#rid); + done = await pollSignal(this.#rid); } catch (error) { if (error instanceof errors.BadResource) { return true; } throw error; } - return res.done; + return done; }; #loop = async () => { -- cgit v1.2.3