diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-04-22 02:48:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-21 20:48:17 -0400 |
commit | 89bb774010b6b80bcbf7c19e8ed28f569abf4d90 (patch) | |
tree | ae6014561d2d1a14a27e7a2ba5c84849eb26ff31 /core/bindings.rs | |
parent | a7b487327595fc7f2a19458dfee54c2d39c706ee (diff) |
refactor(core): kill recv() and init() (#10299)
`init()` was previously needed to init the shared queue, but now that it's
gone `init()` only registers the async msg handler which is snapshot
safe and constant since the op layer refactor.
Diffstat (limited to 'core/bindings.rs')
-rw-r--r-- | core/bindings.rs | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/core/bindings.rs b/core/bindings.rs index 48450a619..7467fe0a8 100644 --- a/core/bindings.rs +++ b/core/bindings.rs @@ -26,9 +26,6 @@ lazy_static::lazy_static! { function: print.map_fn_to() }, v8::ExternalReference { - function: recv.map_fn_to() - }, - v8::ExternalReference { function: send.map_fn_to() }, v8::ExternalReference { @@ -122,7 +119,6 @@ pub fn initialize_context<'s>( // Bind functions to Deno.core.* set_func(scope, core_val, "print", print); - set_func(scope, core_val, "recv", recv); set_func(scope, core_val, "send", send); set_func( scope, @@ -321,27 +317,6 @@ fn print( } } -fn recv( - scope: &mut v8::HandleScope, - args: v8::FunctionCallbackArguments, - _rv: v8::ReturnValue, -) { - let state_rc = JsRuntime::state(scope); - let mut state = state_rc.borrow_mut(); - - let cb = match v8::Local::<v8::Function>::try_from(args.get(0)) { - Ok(cb) => cb, - Err(err) => return throw_type_error(scope, err.to_string()), - }; - - let slot = match &mut state.js_recv_cb { - slot @ None => slot, - _ => return throw_type_error(scope, "Deno.core.recv() already called"), - }; - - slot.replace(v8::Global::new(scope, cb)); -} - fn send<'s>( scope: &mut v8::HandleScope<'s>, args: v8::FunctionCallbackArguments, |