diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2021-02-09 15:31:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-09 16:31:46 +0100 |
commit | 900953a65a7cb54eb8d11eba4a30e52da7dbb469 (patch) | |
tree | 7ca5b7b8261ffd92c945c618ac8bf9eaf15f5ceb /op_crates/web/12_location.js | |
parent | 47b3e4bada01f29a6cf2a143b94d772242bbab67 (diff) |
fix(op_crates): Don't use `Deno.inspect` in op crates (#9332)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Diffstat (limited to 'op_crates/web/12_location.js')
-rw-r--r-- | op_crates/web/12_location.js | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/op_crates/web/12_location.js b/op_crates/web/12_location.js index add2e0e38..6c99bc23a 100644 --- a/op_crates/web/12_location.js +++ b/op_crates/web/12_location.js @@ -166,7 +166,7 @@ enumerable: true, }, [Symbol.for("Deno.customInspect")]: { - value: function () { + value: function (inspect) { const object = { hash: this.hash, host: this.host, @@ -178,12 +178,7 @@ 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(", ") - } }`; + return `${this.constructor.name} ${inspect(object)}`; }, }, }); @@ -328,7 +323,7 @@ configurable: true, }, [Symbol.for("Deno.customInspect")]: { - value: function () { + value: function (inspect) { const object = { hash: this.hash, host: this.host, @@ -340,12 +335,7 @@ 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(", ") - } }`; + return `${this.constructor.name} ${inspect(object)}`; }, }, }); |