summaryrefslogtreecommitdiff
path: root/ext/web/14_compression.js
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2023-11-19 17:13:38 +0900
committerGitHub <noreply@github.com>2023-11-19 09:13:38 +0100
commitc806fbdabe144c865612bbbc9ef596c9611c8310 (patch)
treeedb38d58720377580677ccbeffb693ffa1225cc4 /ext/web/14_compression.js
parenta7548afb58b9848e501a085455446f5de897ffaa (diff)
fix(ext,runtime): add missing custom inspections (#21219)
Diffstat (limited to 'ext/web/14_compression.js')
-rw-r--r--ext/web/14_compression.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/ext/web/14_compression.js b/ext/web/14_compression.js
index 1b6dd4964..0563861c2 100644
--- a/ext/web/14_compression.js
+++ b/ext/web/14_compression.js
@@ -9,9 +9,12 @@ const core = globalThis.Deno.core;
const ops = core.ops;
const primordials = globalThis.__bootstrap.primordials;
const {
+ SymbolFor,
+ ObjectPrototypeIsPrototypeOf,
TypedArrayPrototypeGetByteLength,
} = primordials;
import * as webidl from "ext:deno_webidl/00_webidl.js";
+import { createFilteredInspectProxy } from "ext:deno_console/01_console.js";
import { TransformStream } from "ext:deno_web/06_streams.js";
webidl.converters.CompressionFormat = webidl.createEnumConverter(
@@ -60,6 +63,23 @@ class CompressionStream {
webidl.assertBranded(this, CompressionStreamPrototype);
return this.#transform.writable;
}
+
+ [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
+ return inspect(
+ createFilteredInspectProxy({
+ object: this,
+ evaluate: ObjectPrototypeIsPrototypeOf(
+ CompressionStreamPrototype,
+ this,
+ ),
+ keys: [
+ "readable",
+ "writable",
+ ],
+ }),
+ inspectOptions,
+ );
+ }
}
webidl.configureInterface(CompressionStream);
@@ -102,6 +122,23 @@ class DecompressionStream {
webidl.assertBranded(this, DecompressionStreamPrototype);
return this.#transform.writable;
}
+
+ [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
+ return inspect(
+ createFilteredInspectProxy({
+ object: this,
+ evaluate: ObjectPrototypeIsPrototypeOf(
+ DecompressionStreamPrototype,
+ this,
+ ),
+ keys: [
+ "readable",
+ "writable",
+ ],
+ }),
+ inspectOptions,
+ );
+ }
}
function maybeEnqueue(controller, output) {