diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-12-16 17:14:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-16 17:14:12 +0100 |
commit | 6984b63f2f3c8d0819fe2dced8252a81f3400ae7 (patch) | |
tree | 5201bc962f913927409ae2770aca48ffa3aaaa34 /runtime/rt/40_signals.js | |
parent | 9fe26f8ca189ac81d9c20c454b9dbfa5e1011c3f (diff) |
refactor: rewrite ops to use ResourceTable2 (#8512)
This commit migrates all ops to use new resource table
and "AsyncRefCell".
Old implementation of resource table was completely
removed and all code referencing it was updated to use
new system.
Diffstat (limited to 'runtime/rt/40_signals.js')
-rw-r--r-- | runtime/rt/40_signals.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/runtime/rt/40_signals.js b/runtime/rt/40_signals.js index 739c963fd..091afd66a 100644 --- a/runtime/rt/40_signals.js +++ b/runtime/rt/40_signals.js @@ -3,6 +3,7 @@ ((window) => { const core = window.Deno.core; const { build } = window.__bootstrap.build; + const { errors } = window.__bootstrap.errors; function bindSignal(signo) { return core.jsonOpSync("op_signal_bind", { signo }); @@ -212,7 +213,15 @@ } #pollSignal = async () => { - const res = await pollSignal(this.#rid); + let res; + try { + res = await pollSignal(this.#rid); + } catch (error) { + if (error instanceof errors.BadResource) { + return true; + } + throw error; + } return res.done; }; |