mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(ext,runtime): add missing custom inspections (#21219)
This commit is contained in:
parent
a7548afb58
commit
c806fbdabe
31 changed files with 848 additions and 376 deletions
|
@ -5,6 +5,7 @@
|
|||
const core = globalThis.Deno.core;
|
||||
import { URL } from "ext:deno_url/00_url.js";
|
||||
import * as webidl from "ext:deno_webidl/00_webidl.js";
|
||||
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js";
|
||||
import { HTTP_TOKEN_CODE_POINT_RE } from "ext:deno_web/00_infra.js";
|
||||
import DOMException from "ext:deno_web/01_dom_exception.js";
|
||||
import {
|
||||
|
@ -536,17 +537,26 @@ class WebSocket extends EventTarget {
|
|||
}
|
||||
}
|
||||
|
||||
[SymbolFor("Deno.customInspect")](inspect) {
|
||||
return `${this.constructor.name} ${
|
||||
inspect({
|
||||
url: this.url,
|
||||
readyState: this.readyState,
|
||||
extensions: this.extensions,
|
||||
protocol: this.protocol,
|
||||
binaryType: this.binaryType,
|
||||
bufferedAmount: this.bufferedAmount,
|
||||
})
|
||||
}`;
|
||||
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
|
||||
return inspect(
|
||||
createFilteredInspectProxy({
|
||||
object: this,
|
||||
evaluate: ObjectPrototypeIsPrototypeOf(WebSocketPrototype, this),
|
||||
keys: [
|
||||
"url",
|
||||
"readyState",
|
||||
"extensions",
|
||||
"protocol",
|
||||
"binaryType",
|
||||
"bufferedAmount",
|
||||
"onmessage",
|
||||
"onerror",
|
||||
"onclose",
|
||||
"onopen",
|
||||
],
|
||||
}),
|
||||
inspectOptions,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue