summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/Cargo.toml4
-rw-r--r--runtime/build.rs2
-rw-r--r--runtime/lib.rs2
-rw-r--r--runtime/ops/mod.rs1
-rw-r--r--runtime/ops/url.rs18
-rw-r--r--runtime/web_worker.rs12
-rw-r--r--runtime/worker.rs12
7 files changed, 29 insertions, 22 deletions
diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml
index 0ece4228e..f654e015c 100644
--- a/runtime/Cargo.toml
+++ b/runtime/Cargo.toml
@@ -22,6 +22,8 @@ deno_core = { path = "../core", version = "0.80.2" }
deno_crypto = { path = "../op_crates/crypto", version = "0.14.1" }
deno_fetch = { path = "../op_crates/fetch", version = "0.22.3" }
deno_web = { path = "../op_crates/web", version = "0.30.3" }
+deno_url = { path = "../op_crates/url", version = "0.1.0" }
+deno_webidl = { path = "../op_crates/webidl", version = "0.1.0" }
deno_websocket = { path = "../op_crates/websocket", version = "0.5.3" }
deno_webgpu = { path = "../op_crates/webgpu", version = "0.1.1" }
@@ -34,6 +36,8 @@ deno_core = { path = "../core", version = "0.80.2" }
deno_crypto = { path = "../op_crates/crypto", version = "0.14.1" }
deno_fetch = { path = "../op_crates/fetch", version = "0.22.3" }
deno_web = { path = "../op_crates/web", version = "0.30.3" }
+deno_url = { path = "../op_crates/url", version = "0.1.0" }
+deno_webidl = { path = "../op_crates/webidl", version = "0.1.0" }
deno_websocket = { path = "../op_crates/websocket", version = "0.5.3" }
deno_webgpu = { path = "../op_crates/webgpu", version = "0.1.1" }
diff --git a/runtime/build.rs b/runtime/build.rs
index 248148568..67f80c867 100644
--- a/runtime/build.rs
+++ b/runtime/build.rs
@@ -13,6 +13,8 @@ fn create_snapshot(
snapshot_path: &Path,
files: Vec<PathBuf>,
) {
+ deno_webidl::init(&mut js_runtime);
+ deno_url::init(&mut js_runtime);
deno_web::init(&mut js_runtime);
deno_fetch::init(&mut js_runtime);
deno_websocket::init(&mut js_runtime);
diff --git a/runtime/lib.rs b/runtime/lib.rs
index c523b24b7..140637261 100644
--- a/runtime/lib.rs
+++ b/runtime/lib.rs
@@ -9,8 +9,10 @@ extern crate log;
pub use deno_crypto;
pub use deno_fetch;
+pub use deno_url;
pub use deno_web;
pub use deno_webgpu;
+pub use deno_webidl;
pub use deno_websocket;
pub mod colors;
diff --git a/runtime/ops/mod.rs b/runtime/ops/mod.rs
index 0ef04ff3c..6b64b8042 100644
--- a/runtime/ops/mod.rs
+++ b/runtime/ops/mod.rs
@@ -20,6 +20,7 @@ pub mod signal;
pub mod timers;
pub mod tls;
pub mod tty;
+pub mod url;
pub mod web_worker;
pub mod webgpu;
pub mod websocket;
diff --git a/runtime/ops/url.rs b/runtime/ops/url.rs
new file mode 100644
index 000000000..4add9132d
--- /dev/null
+++ b/runtime/ops/url.rs
@@ -0,0 +1,18 @@
+// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+use deno_url::op_url_parse;
+use deno_url::op_url_parse_search_params;
+use deno_url::op_url_stringify_search_params;
+
+pub fn init(rt: &mut deno_core::JsRuntime) {
+ super::reg_json_sync(rt, "op_url_parse", op_url_parse);
+ super::reg_json_sync(
+ rt,
+ "op_url_parse_search_params",
+ op_url_parse_search_params,
+ );
+ super::reg_json_sync(
+ rt,
+ "op_url_stringify_search_params",
+ op_url_stringify_search_params,
+ );
+}
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs
index 73d351c9c..f35b38d3b 100644
--- a/runtime/web_worker.rs
+++ b/runtime/web_worker.rs
@@ -231,17 +231,7 @@ impl WebWorker {
);
ops::reg_json_sync(js_runtime, "op_close", deno_core::op_close);
ops::reg_json_sync(js_runtime, "op_resources", deno_core::op_resources);
- ops::reg_json_sync(js_runtime, "op_parse_url", deno_web::op_parse_url);
- ops::reg_json_sync(
- js_runtime,
- "op_parse_url_search_params",
- deno_web::op_parse_url_search_params,
- );
- ops::reg_json_sync(
- js_runtime,
- "op_stringify_url_search_params",
- deno_web::op_stringify_url_search_params,
- );
+ ops::url::init(js_runtime);
ops::io::init(js_runtime);
ops::webgpu::init(js_runtime);
ops::websocket::init(
diff --git a/runtime/worker.rs b/runtime/worker.rs
index e63fdbe18..51fe1dc27 100644
--- a/runtime/worker.rs
+++ b/runtime/worker.rs
@@ -127,17 +127,7 @@ impl MainWorker {
ops::crypto::init(js_runtime, options.seed);
ops::reg_json_sync(js_runtime, "op_close", deno_core::op_close);
ops::reg_json_sync(js_runtime, "op_resources", deno_core::op_resources);
- ops::reg_json_sync(js_runtime, "op_parse_url", deno_web::op_parse_url);
- ops::reg_json_sync(
- js_runtime,
- "op_parse_url_search_params",
- deno_web::op_parse_url_search_params,
- );
- ops::reg_json_sync(
- js_runtime,
- "op_stringify_url_search_params",
- deno_web::op_stringify_url_search_params,
- );
+ ops::url::init(js_runtime);
ops::fs_events::init(js_runtime);
ops::fs::init(js_runtime);
ops::io::init(js_runtime);