summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/01_core.js9
-rw-r--r--core/runtime.rs2
2 files changed, 3 insertions, 8 deletions
diff --git a/core/01_core.js b/core/01_core.js
index 296d9bbcf..44267e6fc 100644
--- a/core/01_core.js
+++ b/core/01_core.js
@@ -97,11 +97,6 @@
}
}
- function dispatch(opName, promiseId, control, zeroCopy) {
- const opId = typeof opName === "string" ? opsCache[opName] : opName;
- return opcall(opId, promiseId, control, zeroCopy);
- }
-
function registerErrorClass(className, errorClass) {
registerErrorBuilder(className, (msg) => new errorClass(msg));
}
@@ -130,14 +125,14 @@
function opAsync(opName, arg1 = null, arg2 = null) {
const promiseId = nextPromiseId++;
- const maybeError = dispatch(opName, promiseId, arg1, arg2);
+ const maybeError = opcall(opsCache[opName], promiseId, arg1, arg2);
// Handle sync error (e.g: error parsing args)
if (maybeError) return unwrapOpResult(maybeError);
return PromisePrototypeThen(setPromise(promiseId), unwrapOpResult);
}
function opSync(opName, arg1 = null, arg2 = null) {
- return unwrapOpResult(dispatch(opName, null, arg1, arg2));
+ return unwrapOpResult(opcall(opsCache[opName], null, arg1, arg2));
}
function resources() {
diff --git a/core/runtime.rs b/core/runtime.rs
index 3943415f8..0d566d118 100644
--- a/core/runtime.rs
+++ b/core/runtime.rs
@@ -1848,7 +1848,7 @@ pub mod tests {
r#"
let thrown;
try {
- Deno.core.opSync(100);
+ Deno.core.opcall(100, null, null, null);
} catch (e) {
thrown = e;
}