summaryrefslogtreecommitdiff
path: root/ext/url/01_urlpattern.js
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2023-11-19 17:13:38 +0900
committerGitHub <noreply@github.com>2023-11-19 09:13:38 +0100
commitc806fbdabe144c865612bbbc9ef596c9611c8310 (patch)
treeedb38d58720377580677ccbeffb693ffa1225cc4 /ext/url/01_urlpattern.js
parenta7548afb58b9848e501a085455446f5de897ffaa (diff)
fix(ext,runtime): add missing custom inspections (#21219)
Diffstat (limited to 'ext/url/01_urlpattern.js')
-rw-r--r--ext/url/01_urlpattern.js33
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,
+ );
}
}