0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00

cleanup(core): rename handleAsyncMsgFromRust() to opresolve() (#11774)

No user impact, but is simpler and aligns with `opcall()`
This commit is contained in:
Aaron O'Mullan 2021-08-19 17:19:00 +02:00 committed by GitHub
parent 37c983d1e8
commit bfc197f33e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View file

@ -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,

View file

@ -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();