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/fetch/21_formdata.js | |
parent | a7548afb58b9848e501a085455446f5de897ffaa (diff) |
fix(ext,runtime): add missing custom inspections (#21219)
Diffstat (limited to 'ext/fetch/21_formdata.js')
-rw-r--r-- | ext/fetch/21_formdata.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/fetch/21_formdata.js b/ext/fetch/21_formdata.js index 84d31898e..12ce2bb58 100644 --- a/ext/fetch/21_formdata.js +++ b/ext/fetch/21_formdata.js @@ -26,10 +26,12 @@ const { MapPrototypeSet, MathRandom, ObjectFreeze, + ObjectFromEntries, ObjectPrototypeIsPrototypeOf, SafeMap, SafeRegExp, Symbol, + SymbolFor, StringFromCharCode, StringPrototypeCharCodeAt, StringPrototypeTrim, @@ -262,6 +264,16 @@ class FormData { ArrayPrototypePush(list, entry); } } + + [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { + if (ObjectPrototypeIsPrototypeOf(FormDataPrototype, this)) { + return `${this.constructor.name} ${ + inspect(ObjectFromEntries(this), inspectOptions) + }`; + } else { + return `${this.constructor.name} ${inspect({}, inspectOptions)}`; + } + } } webidl.mixinPairIterable("FormData", FormData, entryList, "name", "value"); |