summaryrefslogtreecommitdiff
path: root/core/core.js
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2021-04-23 17:50:45 +0200
committerGitHub <noreply@github.com>2021-04-23 11:50:45 -0400
commitdd156e886b0d0f7d67538539bf7f3624b817d80a (patch)
tree01022d4993b8590fc7ab78ca9a2e6efe35974fd3 /core/core.js
parent8074d8bcf3cdcc7e9a08df147e0082798a7c2760 (diff)
refactor(core): rename send() to opcall() (#10307)
I think it's a better fit since recv() was killed and opcall <> syscall (send/recv was too reminiscent of request/response and custom payloads)
Diffstat (limited to 'core/core.js')
-rw-r--r--core/core.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/core.js b/core/core.js
index f90dbcc18..a11f281f1 100644
--- a/core/core.js
+++ b/core/core.js
@@ -3,7 +3,7 @@
((window) => {
// Available on start due to bindings.
- const { send } = window.Deno.core;
+ const { opcall } = window.Deno.core;
let opsCache = {};
const errorMap = {
@@ -61,7 +61,7 @@
function ops() {
// op id 0 is a special value to retrieve the map of registered ops.
- const newOpsCache = Object.fromEntries(send(0));
+ const newOpsCache = Object.fromEntries(opcall(0));
opsCache = Object.freeze(newOpsCache);
return opsCache;
}
@@ -76,7 +76,8 @@
}
function dispatch(opName, promiseId, control, zeroCopy) {
- return send(opsCache[opName], promiseId, control, zeroCopy);
+ const opId = typeof opName === "string" ? opsCache[opName] : opName;
+ return opcall(opId, promiseId, control, zeroCopy);
}
function registerErrorClass(className, errorClass) {
@@ -124,8 +125,6 @@
Object.assign(window.Deno.core, {
opAsync,
opSync,
- dispatch: send,
- dispatchByName: dispatch,
ops,
close,
resources,