diff options
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() { |