refactor(core): move op cache sync responsibility to rust space (#10340)

Even if bootstrapping the JS runtime is low level, it's an abstraction leak of 
core to require users to call `Deno.core.ops()` in JS space.

So instead we're introducing a `JsRuntime::sync_ops_cache()` method, 
once we have runtime extensions a new runtime will ensure the ops 
cache is setup (for the provided extensions) and then loading/unloading 
plugins should be the only operations that require op cache syncs
This commit is contained in:
Aaron O'Mullan 2021-04-25 22:00:05 +02:00 committed by GitHub
parent 1c7164257d
commit 83bece56b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 31 additions and 51 deletions

View file

@ -2122,6 +2122,7 @@ pub fn start(debug: bool) -> Result<JsRuntime, AnyError> {
runtime.register_op("op_respond", op(respond));
runtime.register_op("op_script_names", op(script_names));
runtime.register_op("op_script_version", op(script_version));
runtime.sync_ops_cache();
let init_config = json!({ "debug": debug });
let init_src = format!("globalThis.serverInit({});", init_config);