From e83ff62ccbe33ad9c19cb9cab9154b6767d6d74b Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Fri, 12 Mar 2021 16:17:18 +0100 Subject: chore: split web op crate (#9635) This commit starts splitting out the deno_web op crate into multiple smaller crates. This commit splits out WebIDL and URL API, but in the future I want to split out each spec into its own crate. That means we will have (in rough order of loading): `webidl`, `dom`, `streams`, `console`, `encoding`, `url`, `file`, `fetch`, `websocket`, and `webgpu` crates. --- runtime/ops/mod.rs | 1 + runtime/ops/url.rs | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 runtime/ops/url.rs (limited to 'runtime/ops') 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, + ); +} -- cgit v1.2.3