diff options
Diffstat (limited to 'ext/fetch/27_eventsource.js')
-rw-r--r-- | ext/fetch/27_eventsource.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/fetch/27_eventsource.js b/ext/fetch/27_eventsource.js index 6e35bb693..1db65d748 100644 --- a/ext/fetch/27_eventsource.js +++ b/ext/fetch/27_eventsource.js @@ -5,6 +5,7 @@ const core = globalThis.Deno.core; import * as webidl from "ext:deno_webidl/00_webidl.js"; +import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { URL } from "ext:deno_url/00_url.js"; import DOMException from "ext:deno_web/01_dom_exception.js"; import { @@ -25,6 +26,7 @@ const { NumberIsFinite, NumberIsNaN, ObjectDefineProperties, + ObjectPrototypeIsPrototypeOf, Promise, StringPrototypeEndsWith, StringPrototypeIncludes, @@ -34,6 +36,7 @@ const { StringPrototypeStartsWith, StringPrototypeToLowerCase, Symbol, + SymbolFor, } = primordials; // Copied from https://github.com/denoland/deno_std/blob/e0753abe0c8602552862a568348c046996709521/streams/text_line_stream.ts#L20-L74 @@ -345,6 +348,24 @@ class EventSource extends EventTarget { } } } + + [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { + return inspect( + createFilteredInspectProxy({ + object: this, + evaluate: ObjectPrototypeIsPrototypeOf(EventSourcePrototype, this), + keys: [ + "readyState", + "url", + "withCredentials", + "onopen", + "onmessage", + "onerror", + ], + }), + inspectOptions, + ); + } } const EventSourcePrototype = EventSource.prototype; |