From bfc197f33e7df6f3c1a882d70c48ae742e04e288 Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Thu, 19 Aug 2021 17:19:00 +0200 Subject: [PATCH] cleanup(core): rename handleAsyncMsgFromRust() to opresolve() (#11774) No user impact, but is simpler and aligns with `opcall()` --- core/01_core.js | 4 ++-- core/runtime.rs | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/01_core.js b/core/01_core.js index 74e00b5df9..b1497c9340 100644 --- a/core/01_core.js +++ b/core/01_core.js @@ -88,7 +88,7 @@ opsCache = ObjectFreeze(ObjectFromEntries(opcall(0))); } - function handleAsyncMsgFromRust() { + function opresolve() { for (let i = 0; i < arguments.length; i += 2) { const promiseId = arguments[i]; const res = arguments[i + 1]; @@ -179,7 +179,7 @@ resources, registerErrorBuilder, registerErrorClass, - handleAsyncMsgFromRust, + opresolve, syncOpsCache, BadResource, Interrupted, diff --git a/core/runtime.rs b/core/runtime.rs index 8476e5729b..8edd0466c6 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -461,13 +461,12 @@ impl JsRuntime { Ok(()) } - /// Grabs a reference to core.js' handleAsyncMsgFromRust + /// Grabs a reference to core.js' opresolve fn init_recv_cb(&mut self) { let scope = &mut self.handle_scope(); - // Get Deno.core.handleAsyncMsgFromRust - let code = - v8::String::new(scope, "Deno.core.handleAsyncMsgFromRust").unwrap(); + // Get Deno.core.opresolve + let code = v8::String::new(scope, "Deno.core.opresolve").unwrap(); let script = v8::Script::compile(scope, code, None).unwrap(); let v8_value = script.run(scope).unwrap();