diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2023-11-19 17:13:38 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-19 09:13:38 +0100 |
commit | c806fbdabe144c865612bbbc9ef596c9611c8310 (patch) | |
tree | edb38d58720377580677ccbeffb693ffa1225cc4 /ext/url/00_url.js | |
parent | a7548afb58b9848e501a085455446f5de897ffaa (diff) |
fix(ext,runtime): add missing custom inspections (#21219)
Diffstat (limited to 'ext/url/00_url.js')
-rw-r--r-- | ext/url/00_url.js | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/ext/url/00_url.js b/ext/url/00_url.js index ce366a27a..d0ec376d6 100644 --- a/ext/url/00_url.js +++ b/ext/url/00_url.js @@ -8,6 +8,7 @@ const core = globalThis.Deno.core; const ops = core.ops; import * as webidl from "ext:deno_webidl/00_webidl.js"; +import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; const primordials = globalThis.__bootstrap.primordials; const { ArrayIsArray, @@ -17,6 +18,7 @@ const { ArrayPrototypeSort, ArrayPrototypeSplice, ObjectKeys, + ObjectPrototypeIsPrototypeOf, SafeArrayIterator, StringPrototypeSlice, StringPrototypeStartsWith, @@ -410,20 +412,26 @@ class URL { } [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { - const object = { - href: this.href, - origin: this.origin, - protocol: this.protocol, - username: this.username, - password: this.password, - host: this.host, - hostname: this.hostname, - port: this.port, - pathname: this.pathname, - hash: this.hash, - search: this.search, - }; - return `${this.constructor.name} ${inspect(object, inspectOptions)}`; + return inspect( + createFilteredInspectProxy({ + object: this, + evaluate: ObjectPrototypeIsPrototypeOf(URLPrototype, this), + keys: [ + "href", + "origin", + "protocol", + "username", + "password", + "host", + "hostname", + "port", + "pathname", + "hash", + "search", + ], + }), + inspectOptions, + ); } #updateSearchParams() { |