From 2046aeed70efac1e17f1df8873da25e00bb4e2b2 Mon Sep 17 00:00:00 2001 From: lionel-rowe Date: Thu, 14 Sep 2023 13:06:58 +0800 Subject: feat(ext/web): Add name to Deno.customInspect of File objects (#20415) Fixes https://github.com/denoland/deno/issues/20414 --- ext/web/09_file.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ext/web/09_file.js') diff --git a/ext/web/09_file.js b/ext/web/09_file.js index 94981a2f4..fd0451438 100644 --- a/ext/web/09_file.js +++ b/ext/web/09_file.js @@ -535,6 +535,18 @@ class File extends Blob { webidl.assertBranded(this, FilePrototype); return this[_LastModified]; } + + [SymbolFor("Deno.customInspect")](inspect) { + return inspect(createFilteredInspectProxy({ + object: this, + evaluate: ObjectPrototypeIsPrototypeOf(FilePrototype, this), + keys: [ + "name", + "size", + "type", + ], + })); + } } webidl.configurePrototype(File); -- cgit v1.2.3