summaryrefslogtreecommitdiff
path: root/ext/url
diff options
context:
space:
mode:
Diffstat (limited to 'ext/url')
-rw-r--r--ext/url/00_url.js16
-rw-r--r--ext/url/01_urlpattern.js9
2 files changed, 13 insertions, 12 deletions
diff --git a/ext/url/00_url.js b/ext/url/00_url.js
index 06630a2d0..ab87e85e0 100644
--- a/ext/url/00_url.js
+++ b/ext/url/00_url.js
@@ -9,6 +9,7 @@
((window) => {
const core = window.Deno.core;
+ const ops = core.ops;
const webidl = window.__bootstrap.webidl;
const {
ArrayIsArray,
@@ -43,10 +44,12 @@
// Helper functions
function opUrlReparse(href, setter, value) {
- return _urlParts(core.opSync("op_url_reparse", href, [setter, value]));
+ return _urlParts(
+ ops.op_url_reparse(href, [setter, value]),
+ );
}
function opUrlParse(href, maybeBase) {
- return _urlParts(core.opSync("op_url_parse", href, maybeBase));
+ return _urlParts(ops.op_url_parse(href, maybeBase));
}
function _urlParts(internalParts) {
// WARNING: must match UrlParts serialization rust's url_result()
@@ -101,7 +104,7 @@
if (init[0] == "?") {
init = StringPrototypeSlice(init, 1);
}
- this[_list] = core.opSync("op_url_parse_search_params", init);
+ this[_list] = ops.op_url_parse_search_params(init);
} else if (ArrayIsArray(init)) {
// Overload: sequence<sequence<USVString>>
this[_list] = ArrayPrototypeMap(init, (pair, i) => {
@@ -291,7 +294,7 @@
*/
toString() {
webidl.assertBranded(this, URLSearchParamsPrototype);
- return core.opSync("op_url_stringify_search_params", this[_list]);
+ return ops.op_url_stringify_search_params(this[_list]);
}
}
@@ -348,8 +351,7 @@
#updateSearchParams() {
if (this.#queryObject !== null) {
const params = this.#queryObject[_list];
- const newParams = core.opSync(
- "op_url_parse_search_params",
+ const newParams = ops.op_url_parse_search_params(
StringPrototypeSlice(this.search, 1),
);
ArrayPrototypeSplice(
@@ -617,7 +619,7 @@
* @returns {[string, string][]}
*/
function parseUrlEncoded(bytes) {
- return core.opSync("op_url_parse_search_params", null, bytes);
+ return ops.op_url_parse_search_params(null, bytes);
}
webidl
diff --git a/ext/url/01_urlpattern.js b/ext/url/01_urlpattern.js
index 51968e68a..ac18a4c82 100644
--- a/ext/url/01_urlpattern.js
+++ b/ext/url/01_urlpattern.js
@@ -11,6 +11,7 @@
((window) => {
const core = window.Deno.core;
+ const ops = core.ops;
const webidl = window.__bootstrap.webidl;
const {
ArrayPrototypeMap,
@@ -68,7 +69,7 @@
});
}
- const components = core.opSync("op_urlpattern_parse", input, baseURL);
+ const components = ops.op_urlpattern_parse(input, baseURL);
for (const key of ObjectKeys(components)) {
try {
@@ -144,8 +145,7 @@
});
}
- const res = core.opSync(
- "op_urlpattern_process_match_input",
+ const res = ops.op_urlpattern_process_match_input(
input,
baseURL,
);
@@ -184,8 +184,7 @@
});
}
- const res = core.opSync(
- "op_urlpattern_process_match_input",
+ const res = ops.op_urlpattern_process_match_input(
input,
baseURL,
);