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/broadcast_channel/01_broadcast_channel.js | |
parent | a7548afb58b9848e501a085455446f5de897ffaa (diff) |
fix(ext,runtime): add missing custom inspections (#21219)
Diffstat (limited to 'ext/broadcast_channel/01_broadcast_channel.js')
-rw-r--r-- | ext/broadcast_channel/01_broadcast_channel.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ext/broadcast_channel/01_broadcast_channel.js b/ext/broadcast_channel/01_broadcast_channel.js index e5e4169b6..a482a2dce 100644 --- a/ext/broadcast_channel/01_broadcast_channel.js +++ b/ext/broadcast_channel/01_broadcast_channel.js @@ -5,6 +5,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"; import { defineEventHandler, EventTarget, @@ -17,8 +18,10 @@ const { ArrayPrototypeIndexOf, ArrayPrototypePush, ArrayPrototypeSplice, + ObjectPrototypeIsPrototypeOf, PromisePrototypeThen, Symbol, + SymbolFor, Uint8Array, } = primordials; @@ -141,6 +144,21 @@ class BroadcastChannel extends EventTarget { ops.op_broadcast_unsubscribe(rid); } } + + [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { + return inspect( + createFilteredInspectProxy({ + object: this, + evaluate: ObjectPrototypeIsPrototypeOf(BroadcastChannelPrototype, this), + keys: [ + "name", + "onmessage", + "onmessageerror", + ], + }), + inspectOptions, + ); + } } defineEventHandler(BroadcastChannel.prototype, "message"); |