summaryrefslogtreecommitdiff
path: root/op_crates/url
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2021-04-25 22:00:05 +0200
committerGitHub <noreply@github.com>2021-04-25 22:00:05 +0200
commit83bece56b01f6997cb71e9289a4d83a398cde0c8 (patch)
tree6f688f86bffd3ada71f7afa67d27a812d0bae386 /op_crates/url
parent1c7164257d146c279b61708ddf8514d85b5fc11c (diff)
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
Diffstat (limited to 'op_crates/url')
-rw-r--r--op_crates/url/benches/url_ops.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/op_crates/url/benches/url_ops.rs b/op_crates/url/benches/url_ops.rs
index 37efb0a33..7d5d32879 100644
--- a/op_crates/url/benches/url_ops.rs
+++ b/op_crates/url/benches/url_ops.rs
@@ -15,6 +15,7 @@ fn create_js_runtime() -> JsRuntime {
"op_url_stringify_search_params",
op_sync(deno_url::op_url_stringify_search_params),
);
+ runtime.sync_ops_cache();
runtime
.execute(
@@ -24,14 +25,6 @@ fn create_js_runtime() -> JsRuntime {
.unwrap();
deno_url::init(&mut runtime);
runtime
- .execute(
- "init",
- r#"
- Deno.core.ops();
- "#,
- )
- .unwrap();
- runtime
.execute("setup", "const { URL } = globalThis.__bootstrap.url;")
.unwrap();