diff options
Diffstat (limited to 'ext/url/01_urlpattern.js')
-rw-r--r-- | ext/url/01_urlpattern.js | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/ext/url/01_urlpattern.js b/ext/url/01_urlpattern.js index 0cabccc1b..71962d405 100644 --- a/ext/url/01_urlpattern.js +++ b/ext/url/01_urlpattern.js @@ -10,11 +10,13 @@ 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 { ArrayPrototypePop, RegExpPrototypeExec, RegExpPrototypeTest, + ObjectPrototypeIsPrototypeOf, SafeRegExp, Symbol, SymbolFor, @@ -222,19 +224,24 @@ class URLPattern { return result; } - [SymbolFor("Deno.customInspect")](inspect) { - return `URLPattern ${ - inspect({ - protocol: this.protocol, - username: this.username, - password: this.password, - hostname: this.hostname, - port: this.port, - pathname: this.pathname, - search: this.search, - hash: this.hash, - }) - }`; + [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { + return inspect( + createFilteredInspectProxy({ + object: this, + evaluate: ObjectPrototypeIsPrototypeOf(URLPatternPrototype, this), + keys: [ + "protocol", + "username", + "password", + "hostname", + "port", + "pathname", + "search", + "hash", + ], + }), + inspectOptions, + ); } } |