summaryrefslogtreecommitdiff
path: root/op_crates/web/12_location.js
diff options
context:
space:
mode:
Diffstat (limited to 'op_crates/web/12_location.js')
-rw-r--r--op_crates/web/12_location.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/op_crates/web/12_location.js b/op_crates/web/12_location.js
index d6a132413..f2409e82a 100644
--- a/op_crates/web/12_location.js
+++ b/op_crates/web/12_location.js
@@ -164,6 +164,27 @@
},
enumerable: true,
},
+ [Symbol.for("Deno.customInspect")]: {
+ value: function () {
+ const object = {
+ hash: this.hash,
+ host: this.host,
+ hostname: this.hostname,
+ href: this.href,
+ origin: this.origin,
+ pathname: this.pathname,
+ port: this.port,
+ protocol: this.protocol,
+ search: this.search,
+ };
+ if (typeof globalThis?.Deno?.inspect == "function") {
+ return `Location ${Deno.inspect(object)}`;
+ }
+ return `Location { ${
+ Object.entries(object).map(([k, v]) => `${k}: ${v}`).join(", ")
+ } }`;
+ },
+ },
});
}
}
@@ -305,6 +326,27 @@
value: "WorkerLocation",
configurable: true,
},
+ [Symbol.for("Deno.customInspect")]: {
+ value: function () {
+ const object = {
+ hash: this.hash,
+ host: this.host,
+ hostname: this.hostname,
+ href: this.href,
+ origin: this.origin,
+ pathname: this.pathname,
+ port: this.port,
+ protocol: this.protocol,
+ search: this.search,
+ };
+ if (typeof globalThis?.Deno?.inspect == "function") {
+ return `WorkerLocation ${Deno.inspect(object)}`;
+ }
+ return `WorkerLocation { ${
+ Object.entries(object).map(([k, v]) => `${k}: ${v}`).join(", ")
+ } }`;
+ },
+ },
});
let location = null;