1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

fix: remove inspect proxy abstraction

This commit is contained in:
Marvin Hagemeister 2024-08-16 13:34:09 +02:00
parent 0c26d9b638
commit 71ab7d44c5
28 changed files with 405 additions and 1030 deletions

View file

@ -13,14 +13,13 @@ const {
ArrayPrototypeIndexOf, ArrayPrototypeIndexOf,
ArrayPrototypePush, ArrayPrototypePush,
ArrayPrototypeSplice, ArrayPrototypeSplice,
ObjectPrototypeIsPrototypeOf,
Symbol, Symbol,
SymbolFor, SymbolFor,
Uint8Array, Uint8Array,
} = primordials; } = primordials;
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import { import {
defineEventHandler, defineEventHandler,
EventTarget, EventTarget,
@ -143,18 +142,7 @@ class BroadcastChannel extends EventTarget {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["canvas"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(BroadcastChannelPrototype, this),
keys: [
"name",
"onmessage",
"onmessageerror",
],
}),
inspectOptions,
);
} }
} }

View file

@ -4,7 +4,7 @@ import { internals, primordials } from "ext:core/mod.js";
import { op_image_decode_png, op_image_process } from "ext:core/ops"; import { op_image_decode_png, op_image_process } from "ext:core/ops";
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { DOMException } from "ext:deno_web/01_dom_exception.js"; import { DOMException } from "ext:deno_web/01_dom_exception.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import { BlobPrototype } from "ext:deno_web/09_file.js"; import { BlobPrototype } from "ext:deno_web/09_file.js";
import { sniffImage } from "ext:deno_web/01_mimesniff.js"; import { sniffImage } from "ext:deno_web/01_mimesniff.js";
const { const {
@ -140,17 +140,7 @@ class ImageBitmap {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["width", "height"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(ImageBitmapPrototype, this),
keys: [
"width",
"height",
],
}),
inspectOptions,
);
} }
} }
const ImageBitmapPrototype = ImageBitmap.prototype; const ImageBitmapPrototype = ImageBitmap.prototype;

View file

@ -102,10 +102,7 @@ const {
ObjectPrototypePropertyIsEnumerable, ObjectPrototypePropertyIsEnumerable,
ObjectSetPrototypeOf, ObjectSetPrototypeOf,
ObjectValues, ObjectValues,
Proxy,
ReflectGet, ReflectGet,
ReflectGetOwnPropertyDescriptor,
ReflectGetPrototypeOf,
ReflectHas, ReflectHas,
ReflectOwnKeys, ReflectOwnKeys,
RegExpPrototypeExec, RegExpPrototypeExec,
@ -471,7 +468,7 @@ function formatValue(
// inspect implementations in `extensions` need it, but may not have access // inspect implementations in `extensions` need it, but may not have access
// to the `Deno` namespace in web workers. Remove when the `Deno` // to the `Deno` namespace in web workers. Remove when the `Deno`
// namespace is always enabled. // namespace is always enabled.
return String(value[privateCustomInspect](inspect, ctx)); return String(value[privateCustomInspect].call(value, inspect, ctx));
} else if (ReflectHas(value, nodeCustomInspectSymbol)) { } else if (ReflectHas(value, nodeCustomInspectSymbol)) {
const maybeCustom = value[nodeCustomInspectSymbol]; const maybeCustom = value[nodeCustomInspectSymbol];
if ( if (
@ -3449,67 +3446,24 @@ function inspect(
return formatValue(ctx, value, 0); return formatValue(ctx, value, 0);
} }
class FilteredProxy extends Proxy { /**
privateCustomInspectProxy; * Print a serialized version of the passed object with only the
} * keys specified. This is used in `Deno.privateCustomInspect()`
* @template T
/** Creates a proxy that represents a subset of the properties * @param {T} obj
* of the original object optionally without evaluating the properties * @param {keyof T} keys
* in order to get the values. */ * @param {typeof inspect} inspect
function createFilteredInspectProxy({ object, keys, evaluate }) { * @param {*} inspectOptions
const obj = class {}; * @returns {string}
if (object.constructor?.name) { */
ObjectDefineProperty(obj, "name", { value: object.constructor.name }); function privateInspect(obj, keys, inspect, inspectOptions) {
const value = {};
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
value[key] = ReflectGet(obj, key);
} }
return new Proxy(new obj(), { return `${obj.constructor.name} ${inspect(value, inspectOptions)}`;
get(_target, key) {
if (key === SymbolToStringTag) {
return object.constructor?.name;
} else if (key === privateCustomInspectProxy) {
return true;
} else if (ArrayPrototypeIncludes(keys, key)) {
return ReflectGet(object, key);
} else {
return undefined;
}
},
getOwnPropertyDescriptor(_target, key) {
if (!ArrayPrototypeIncludes(keys, key)) {
return undefined;
} else if (evaluate) {
return getEvaluatedDescriptor(object, key);
} else {
return getDescendantPropertyDescriptor(object, key) ??
getEvaluatedDescriptor(object, key);
}
},
has(_target, key) {
return ArrayPrototypeIncludes(keys, key);
},
ownKeys() {
return keys;
},
});
function getDescendantPropertyDescriptor(object, key) {
let propertyDescriptor = ReflectGetOwnPropertyDescriptor(object, key);
if (!propertyDescriptor) {
const prototype = ReflectGetPrototypeOf(object);
if (prototype) {
propertyDescriptor = getDescendantPropertyDescriptor(prototype, key);
}
}
return propertyDescriptor;
}
function getEvaluatedDescriptor(object, key) {
return {
configurable: true,
enumerable: true,
value: object[key],
};
}
} }
// Expose these fields to internalObject for tests. // Expose these fields to internalObject for tests.
@ -3522,7 +3476,6 @@ internals.parseCssColor = parseCssColor;
export { export {
colors, colors,
Console, Console,
createFilteredInspectProxy,
createStylizeWithColor, createStylizeWithColor,
CSI, CSI,
customInspect, customInspect,
@ -3534,6 +3487,7 @@ export {
getStdoutNoColor, getStdoutNoColor,
inspect, inspect,
inspectArgs, inspectArgs,
privateInspect,
quoteString, quoteString,
setNoColorFns, setNoColorFns,
styles, styles,

View file

@ -81,8 +81,8 @@ const {
} = primordials; } = primordials;
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js";
import { DOMException } from "ext:deno_web/01_dom_exception.js"; import { DOMException } from "ext:deno_web/01_dom_exception.js";
import { privateInspect } from "ext:deno_console/01_console.js";
const supportedNamedCurves = ["P-256", "P-384", "P-521"]; const supportedNamedCurves = ["P-256", "P-384", "P-521"];
const recognisedUsages = [ const recognisedUsages = [
@ -380,17 +380,10 @@ class CryptoKey {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, ["type", "extractable", "algorithm", "usages"],
evaluate: ObjectPrototypeIsPrototypeOf(CryptoKeyPrototype, this), inspect,
keys: [
"type",
"extractable",
"algorithm",
"usages",
],
}),
inspectOptions, inspectOptions,
); );
} }
@ -4757,14 +4750,7 @@ class Crypto {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["subtle"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(CryptoPrototype, this),
keys: ["subtle"],
}),
inspectOptions,
);
} }
} }

View file

@ -25,7 +25,7 @@ const {
} = primordials; } = primordials;
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import { import {
byteUpperCase, byteUpperCase,
HTTP_TOKEN_CODE_POINT_RE, HTTP_TOKEN_CODE_POINT_RE,
@ -511,18 +511,10 @@ class Request {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, ["bodyUsed", "headers", "method", "redirect", "url"],
evaluate: ObjectPrototypeIsPrototypeOf(RequestPrototype, this), inspect,
keys: [
"bodyUsed",
"headers",
"method",
"redirect",
"url",
],
}),
inspectOptions, inspectOptions,
); );
} }

View file

@ -12,7 +12,7 @@
import { core, primordials } from "ext:core/mod.js"; import { core, primordials } from "ext:core/mod.js";
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import { import {
byteLowerCase, byteLowerCase,
HTTP_TAB_OR_SPACE, HTTP_TAB_OR_SPACE,
@ -34,7 +34,6 @@ const {
ArrayPrototypeMap, ArrayPrototypeMap,
ArrayPrototypePush, ArrayPrototypePush,
ObjectDefineProperties, ObjectDefineProperties,
ObjectPrototypeIsPrototypeOf,
RangeError, RangeError,
RegExpPrototypeExec, RegExpPrototypeExec,
SafeArrayIterator, SafeArrayIterator,
@ -408,11 +407,9 @@ class Response {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, [
evaluate: ObjectPrototypeIsPrototypeOf(ResponsePrototype, this),
keys: [
"body", "body",
"bodyUsed", "bodyUsed",
"headers", "headers",
@ -422,7 +419,7 @@ class Response {
"statusText", "statusText",
"url", "url",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }

View file

@ -10,7 +10,6 @@ const {
NumberIsFinite, NumberIsFinite,
NumberIsNaN, NumberIsNaN,
ObjectDefineProperties, ObjectDefineProperties,
ObjectPrototypeIsPrototypeOf,
StringPrototypeEndsWith, StringPrototypeEndsWith,
StringPrototypeIncludes, StringPrototypeIncludes,
StringPrototypeIndexOf, StringPrototypeIndexOf,
@ -21,7 +20,7 @@ const {
} = primordials; } = primordials;
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import { URL } from "ext:deno_url/00_url.js"; import { URL } from "ext:deno_url/00_url.js";
import { DOMException } from "ext:deno_web/01_dom_exception.js"; import { DOMException } from "ext:deno_web/01_dom_exception.js";
import { import {
@ -333,11 +332,9 @@ class EventSource extends EventTarget {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, [
evaluate: ObjectPrototypeIsPrototypeOf(EventSourcePrototype, this),
keys: [
"readyState", "readyState",
"url", "url",
"withCredentials", "withCredentials",
@ -345,7 +342,7 @@ class EventSource extends EventTarget {
"onmessage", "onmessage",
"onerror", "onerror",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }

View file

@ -22,7 +22,6 @@ const {
ArrayPrototypeSort, ArrayPrototypeSort,
ArrayPrototypeSplice, ArrayPrototypeSplice,
ObjectKeys, ObjectKeys,
ObjectPrototypeIsPrototypeOf,
SafeArrayIterator, SafeArrayIterator,
StringPrototypeSlice, StringPrototypeSlice,
StringPrototypeStartsWith, StringPrototypeStartsWith,
@ -34,7 +33,7 @@ const {
} = primordials; } = primordials;
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
const _list = Symbol("list"); const _list = Symbol("list");
const _urlObject = Symbol("url object"); const _urlObject = Symbol("url object");
@ -459,11 +458,9 @@ class URL {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, [
evaluate: ObjectPrototypeIsPrototypeOf(URLPrototype, this),
keys: [
"href", "href",
"origin", "origin",
"protocol", "protocol",
@ -476,7 +473,7 @@ class URL {
"hash", "hash",
"search", "search",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }

View file

@ -17,7 +17,6 @@ const {
MathRandom, MathRandom,
ObjectAssign, ObjectAssign,
ObjectCreate, ObjectCreate,
ObjectPrototypeIsPrototypeOf,
RegExpPrototypeExec, RegExpPrototypeExec,
RegExpPrototypeTest, RegExpPrototypeTest,
SafeMap, SafeMap,
@ -28,7 +27,7 @@ const {
} = primordials; } = primordials;
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
const _components = Symbol("components"); const _components = Symbol("components");
@ -368,11 +367,9 @@ class URLPattern {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, [
evaluate: ObjectPrototypeIsPrototypeOf(URLPatternPrototype, this),
keys: [
"protocol", "protocol",
"username", "username",
"password", "password",
@ -383,7 +380,7 @@ class URLPattern {
"hash", "hash",
"hasRegExpGroups", "hasRegExpGroups",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }

View file

@ -15,14 +15,13 @@ const {
ObjectCreate, ObjectCreate,
ObjectEntries, ObjectEntries,
ObjectHasOwn, ObjectHasOwn,
ObjectPrototypeIsPrototypeOf,
ObjectSetPrototypeOf, ObjectSetPrototypeOf,
Symbol, Symbol,
SymbolFor, SymbolFor,
} = primordials; } = primordials;
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
const _name = Symbol("name"); const _name = Symbol("name");
const _message = Symbol("message"); const _message = Symbol("message");
@ -137,16 +136,10 @@ class DOMException {
return stack; return stack;
} }
} }
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, ["message", "name", "code"],
evaluate: ObjectPrototypeIsPrototypeOf(DOMExceptionPrototype, this), inspect,
keys: [
"message",
"name",
"code",
],
}),
inspectOptions, inspectOptions,
); );
} }

View file

@ -36,7 +36,7 @@ const {
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { DOMException } from "./01_dom_exception.js"; import { DOMException } from "./01_dom_exception.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
// This should be set via setGlobalThis this is required so that if even // This should be set via setGlobalThis this is required so that if even
// user deletes globalThis it is still usable // user deletes globalThis it is still usable
@ -158,14 +158,7 @@ class Event {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, EVENT_PROPS, inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(EventPrototype, this),
keys: EVENT_PROPS,
}),
inspectOptions,
);
} }
get type() { get type() {
@ -387,8 +380,6 @@ class Event {
} }
} }
const EventPrototype = Event.prototype;
// Not spec compliant. The spec defines it as [LegacyUnforgeable] // Not spec compliant. The spec defines it as [LegacyUnforgeable]
// but doing so has a big performance hit // but doing so has a big performance hit
ReflectDefineProperty(Event.prototype, "isTrusted", { ReflectDefineProperty(Event.prototype, "isTrusted", {
@ -1111,11 +1102,9 @@ class ErrorEvent extends Event {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, [
evaluate: ObjectPrototypeIsPrototypeOf(ErrorEventPrototype, this),
keys: [
...new SafeArrayIterator(EVENT_PROPS), ...new SafeArrayIterator(EVENT_PROPS),
"message", "message",
"filename", "filename",
@ -1123,7 +1112,7 @@ class ErrorEvent extends Event {
"colno", "colno",
"error", "error",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }
@ -1177,24 +1166,20 @@ class CloseEvent extends Event {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, [
evaluate: ObjectPrototypeIsPrototypeOf(CloseEventPrototype, this),
keys: [
...new SafeArrayIterator(EVENT_PROPS), ...new SafeArrayIterator(EVENT_PROPS),
"wasClean", "wasClean",
"code", "code",
"reason", "reason",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }
} }
const CloseEventPrototype = CloseEvent.prototype;
class MessageEvent extends Event { class MessageEvent extends Event {
get source() { get source() {
return null; return null;
@ -1214,17 +1199,15 @@ class MessageEvent extends Event {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, [
evaluate: ObjectPrototypeIsPrototypeOf(MessageEventPrototype, this),
keys: [
...new SafeArrayIterator(EVENT_PROPS), ...new SafeArrayIterator(EVENT_PROPS),
"data", "data",
"origin", "origin",
"lastEventId", "lastEventId",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }
@ -1233,8 +1216,6 @@ class MessageEvent extends Event {
[SymbolToStringTag] = "MessageEvent"; [SymbolToStringTag] = "MessageEvent";
} }
const MessageEventPrototype = MessageEvent.prototype;
class CustomEvent extends Event { class CustomEvent extends Event {
#detail = null; #detail = null;
@ -1254,15 +1235,13 @@ class CustomEvent extends Event {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, [
evaluate: ObjectPrototypeIsPrototypeOf(CustomEventPrototype, this),
keys: [
...new SafeArrayIterator(EVENT_PROPS), ...new SafeArrayIterator(EVENT_PROPS),
"detail", "detail",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }
@ -1271,8 +1250,6 @@ class CustomEvent extends Event {
[SymbolToStringTag] = "CustomEvent"; [SymbolToStringTag] = "CustomEvent";
} }
const CustomEventPrototype = CustomEvent.prototype;
ReflectDefineProperty(CustomEvent.prototype, "detail", { ReflectDefineProperty(CustomEvent.prototype, "detail", {
enumerable: true, enumerable: true,
}); });
@ -1289,17 +1266,15 @@ class ProgressEvent extends Event {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, [
evaluate: ObjectPrototypeIsPrototypeOf(ProgressEventPrototype, this),
keys: [
...new SafeArrayIterator(EVENT_PROPS), ...new SafeArrayIterator(EVENT_PROPS),
"lengthComputable", "lengthComputable",
"loaded", "loaded",
"total", "total",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }
@ -1308,8 +1283,6 @@ class ProgressEvent extends Event {
[SymbolToStringTag] = "ProgressEvent"; [SymbolToStringTag] = "ProgressEvent";
} }
const ProgressEventPrototype = ProgressEvent.prototype;
class PromiseRejectionEvent extends Event { class PromiseRejectionEvent extends Event {
#promise = null; #promise = null;
#reason = null; #reason = null;
@ -1342,19 +1315,14 @@ class PromiseRejectionEvent extends Event {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
PromiseRejectionEventPrototype,
this, this,
), [
keys: [
...new SafeArrayIterator(EVENT_PROPS), ...new SafeArrayIterator(EVENT_PROPS),
"promise", "promise",
"reason", "reason",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }
@ -1363,8 +1331,6 @@ class PromiseRejectionEvent extends Event {
[SymbolToStringTag] = "PromiseRejectionEvent"; [SymbolToStringTag] = "PromiseRejectionEvent";
} }
const PromiseRejectionEventPrototype = PromiseRejectionEvent.prototype;
defineEnumerableProps(PromiseRejectionEvent, [ defineEnumerableProps(PromiseRejectionEvent, [
"promise", "promise",
"reason", "reason",

View file

@ -8,7 +8,6 @@ const {
ArrayPrototypeEvery, ArrayPrototypeEvery,
ArrayPrototypePush, ArrayPrototypePush,
FunctionPrototypeApply, FunctionPrototypeApply,
ObjectPrototypeIsPrototypeOf,
SafeSet, SafeSet,
SafeSetIterator, SafeSetIterator,
SafeWeakRef, SafeWeakRef,
@ -25,7 +24,7 @@ const {
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { assert } from "./00_infra.js"; import { assert } from "./00_infra.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import { import {
defineEventHandler, defineEventHandler,
Event, Event,
@ -250,16 +249,10 @@ class AbortSignal extends EventTarget {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, ["aborted", "reason", "onabort"],
evaluate: ObjectPrototypeIsPrototypeOf(AbortSignalPrototype, this), inspect,
keys: [
"aborted",
"reason",
"onabort",
],
}),
inspectOptions, inspectOptions,
); );
} }
@ -287,16 +280,7 @@ class AbortController {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["signal"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(AbortControllerPrototype, this),
keys: [
"signal",
],
}),
inspectOptions,
);
} }
} }

View file

@ -99,7 +99,7 @@ import {
signalAbort, signalAbort,
} from "./03_abort_signal.js"; } from "./03_abort_signal.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import { assert, AssertionError } from "./00_infra.js"; import { assert, AssertionError } from "./00_infra.js";
/** @template T */ /** @template T */
@ -4993,18 +4993,10 @@ class ByteLengthQueuingStrategy {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
ByteLengthQueuingStrategyPrototype,
this, this,
), ["highWaterMark", "size"],
keys: [ inspect,
"highWaterMark",
"size",
],
}),
inspectOptions, inspectOptions,
); );
} }
@ -5050,18 +5042,10 @@ class CountQueuingStrategy {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
CountQueuingStrategyPrototype,
this, this,
), ["highWaterMark", "size"],
keys: [ inspect,
"highWaterMark",
"size",
],
}),
inspectOptions, inspectOptions,
); );
} }
@ -5365,17 +5349,7 @@ class ReadableStream {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["locked"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
ReadableStreamPrototype,
this,
),
keys: ["locked"],
}),
inspectOptions,
);
} }
} }
@ -5487,17 +5461,7 @@ class ReadableStreamDefaultReader {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["closed"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
ReadableStreamDefaultReaderPrototype,
this,
),
keys: ["closed"],
}),
inspectOptions,
);
} }
} }
@ -5657,17 +5621,7 @@ class ReadableStreamBYOBReader {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["closed"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
ReadableStreamBYOBReaderPrototype,
this,
),
keys: ["closed"],
}),
inspectOptions,
);
} }
} }
@ -5883,17 +5837,7 @@ class ReadableByteStreamController {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["desiredSize"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
ReadableByteStreamControllerPrototype,
this,
),
keys: ["desiredSize"],
}),
inspectOptions,
);
} }
/** /**
@ -6037,17 +5981,7 @@ class ReadableStreamDefaultController {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["desiredSize"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
ReadableStreamDefaultControllerPrototype,
this,
),
keys: ["desiredSize"],
}),
inspectOptions,
);
} }
/** /**
@ -6199,15 +6133,10 @@ class TransformStream {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
TransformStreamPrototype,
this, this,
), ["readable", "writable"],
keys: ["readable", "writable"], inspect,
}),
inspectOptions, inspectOptions,
); );
} }
@ -6276,17 +6205,7 @@ class TransformStreamDefaultController {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["desiredSize"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
TransformStreamDefaultControllerPrototype,
this,
),
keys: ["desiredSize"],
}),
inspectOptions,
);
} }
} }
@ -6427,17 +6346,7 @@ class WritableStream {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["locked"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
WritableStreamPrototype,
this,
),
keys: ["locked"],
}),
inspectOptions,
);
} }
} }
@ -6572,19 +6481,10 @@ class WritableStreamDefaultWriter {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
WritableStreamDefaultWriterPrototype,
this, this,
), ["closed", "desiredSize", "ready"],
keys: [ inspect,
"closed",
"desiredSize",
"ready",
],
}),
inspectOptions, inspectOptions,
); );
} }
@ -6646,17 +6546,7 @@ class WritableStreamDefaultController {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["signal"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
WritableStreamDefaultControllerPrototype,
this,
),
keys: ["signal"],
}),
inspectOptions,
);
} }
/** /**

View file

@ -27,7 +27,6 @@ const {
DataViewPrototypeGetBuffer, DataViewPrototypeGetBuffer,
DataViewPrototypeGetByteLength, DataViewPrototypeGetByteLength,
DataViewPrototypeGetByteOffset, DataViewPrototypeGetByteOffset,
ObjectPrototypeIsPrototypeOf,
PromiseReject, PromiseReject,
PromiseResolve, PromiseResolve,
// TODO(lucacasonato): add SharedArrayBuffer to primordials // TODO(lucacasonato): add SharedArrayBuffer to primordials
@ -44,7 +43,7 @@ const {
} = primordials; } = primordials;
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
class TextDecoder { class TextDecoder {
/** @type {string} */ /** @type {string} */
@ -189,16 +188,10 @@ class TextDecoder {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, ["encoding", "fatal", "ignoreBOM"],
evaluate: ObjectPrototypeIsPrototypeOf(TextDecoderPrototype, this), inspect,
keys: [
"encoding",
"fatal",
"ignoreBOM",
],
}),
inspectOptions, inspectOptions,
); );
} }
@ -261,14 +254,7 @@ class TextEncoder {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["encoding"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(TextEncoderPrototype, this),
keys: ["encoding"],
}),
inspectOptions,
);
} }
} }
@ -367,21 +353,10 @@ class TextDecoderStream {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
TextDecoderStreamPrototype,
this, this,
), ["encoding", "fatal", "ignoreBOM", "readable", "writable"],
keys: [ inspect,
"encoding",
"fatal",
"ignoreBOM",
"readable",
"writable",
],
}),
inspectOptions, inspectOptions,
); );
} }
@ -460,19 +435,10 @@ class TextEncoderStream {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
TextEncoderStreamPrototype,
this, this,
), ["encoding", "readbale", "writable"],
keys: [ inspect,
"encoding",
"readable",
"writable",
],
}),
inspectOptions, inspectOptions,
); );
} }

View file

@ -59,7 +59,7 @@ const {
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { ReadableStream } from "./06_streams.js"; import { ReadableStream } from "./06_streams.js";
import { URL } from "ext:deno_url/00_url.js"; import { URL } from "ext:deno_url/00_url.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
// TODO(lucacasonato): this needs to not be hardcoded and instead depend on // TODO(lucacasonato): this needs to not be hardcoded and instead depend on
// host os. // host os.
@ -435,17 +435,10 @@ class Blob {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( // return privateInspect(this, ["size", "type"], inspect, inspectOptions);
createFilteredInspectProxy({ const { size, type } = this;
object: this, const value = { size, type };
evaluate: ObjectPrototypeIsPrototypeOf(BlobPrototype, this), return `${this.constructor.name} ${inspect(value, inspectOptions)}`;
keys: [
"size",
"type",
],
}),
inspectOptions,
);
} }
} }
@ -554,16 +547,10 @@ class File extends Blob {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, ["name", "size", "type"],
evaluate: ObjectPrototypeIsPrototypeOf(FilePrototype, this), inspect,
keys: [
"name",
"size",
"type",
],
}),
inspectOptions, inspectOptions,
); );
} }

View file

@ -19,7 +19,6 @@ const {
MapPrototypeGet, MapPrototypeGet,
MapPrototypeSet, MapPrototypeSet,
ObjectDefineProperty, ObjectDefineProperty,
ObjectPrototypeIsPrototypeOf,
queueMicrotask, queueMicrotask,
SafeArrayIterator, SafeArrayIterator,
SafeMap, SafeMap,
@ -34,7 +33,7 @@ const {
} = primordials; } = primordials;
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import { forgivingBase64Encode } from "./00_infra.js"; import { forgivingBase64Encode } from "./00_infra.js";
import { EventTarget, ProgressEvent } from "./02_event.js"; import { EventTarget, ProgressEvent } from "./02_event.js";
import { decode, TextDecoder } from "./08_text_encoding.js"; import { decode, TextDecoder } from "./08_text_encoding.js";
@ -435,16 +434,10 @@ class FileReader extends EventTarget {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, ["error", "readyState", "result"],
evaluate: ObjectPrototypeIsPrototypeOf(FileReaderPrototype, this), inspect,
keys: [
"error",
"readyState",
"result",
],
}),
inspectOptions, inspectOptions,
); );
} }

View file

@ -30,7 +30,7 @@ const {
isArrayBuffer, isArrayBuffer,
} = core; } = core;
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import { import {
defineEventHandler, defineEventHandler,
EventTarget, EventTarget,
@ -69,17 +69,7 @@ class MessageChannel {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["port1", "port2"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(MessageChannelPrototype, this),
keys: [
"port1",
"port2",
],
}),
inspectOptions,
);
} }
} }
@ -277,15 +267,10 @@ class MessagePort extends EventTarget {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspectSerialize(
createFilteredInspectProxy({ this,
object: this, ["onmessage", "onmessageerror"],
evaluate: ObjectPrototypeIsPrototypeOf(MessagePortPrototype, this), inspect,
keys: [
"onmessage",
"onmessageerror",
],
}),
inspectOptions, inspectOptions,
); );
} }

View file

@ -13,12 +13,11 @@ import {
} from "ext:core/ops"; } from "ext:core/ops";
const { const {
SymbolFor, SymbolFor,
ObjectPrototypeIsPrototypeOf,
TypedArrayPrototypeGetByteLength, TypedArrayPrototypeGetByteLength,
} = primordials; } = primordials;
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import { TransformStream } from "./06_streams.js"; import { TransformStream } from "./06_streams.js";
webidl.converters.CompressionFormat = webidl.createEnumConverter( webidl.converters.CompressionFormat = webidl.createEnumConverter(
@ -72,18 +71,10 @@ class CompressionStream {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
CompressionStreamPrototype,
this, this,
), ["readable", "writable"],
keys: [ inspect,
"readable",
"writable",
],
}),
inspectOptions, inspectOptions,
); );
} }
@ -134,18 +125,10 @@ class DecompressionStream {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
DecompressionStreamPrototype,
this, this,
), ["readable", "writable"],
keys: [ inspect,
"readable",
"writable",
],
}),
inspectOptions, inspectOptions,
); );
} }

View file

@ -8,7 +8,6 @@ const {
ArrayPrototypeReverse, ArrayPrototypeReverse,
ArrayPrototypeSlice, ArrayPrototypeSlice,
ObjectKeys, ObjectKeys,
ObjectPrototypeIsPrototypeOf,
ReflectHas, ReflectHas,
Symbol, Symbol,
SymbolFor, SymbolFor,
@ -17,7 +16,7 @@ const {
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { structuredClone } from "./02_structured_clone.js"; import { structuredClone } from "./02_structured_clone.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import { EventTarget } from "./02_event.js"; import { EventTarget } from "./02_event.js";
import { opNow } from "./02_timers.js"; import { opNow } from "./02_timers.js";
import { DOMException } from "./01_dom_exception.js"; import { DOMException } from "./01_dom_exception.js";
@ -197,20 +196,10 @@ class PerformanceEntry {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
PerformanceEntryPrototype,
this, this,
), ["name", "entryType", "startTime", "duration"],
keys: [ inspect,
"name",
"entryType",
"startTime",
"duration",
],
}),
inspectOptions, inspectOptions,
); );
} }
@ -269,18 +258,10 @@ class PerformanceMark extends PerformanceEntry {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, ["name", "entryType", "startTime", "duration", "detail"],
evaluate: ObjectPrototypeIsPrototypeOf(PerformanceMarkPrototype, this), inspect,
keys: [
"name",
"entryType",
"startTime",
"duration",
"detail",
],
}),
inspectOptions, inspectOptions,
); );
} }
@ -328,21 +309,10 @@ class PerformanceMeasure extends PerformanceEntry {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
PerformanceMeasurePrototype,
this, this,
), ["entryType", "startTime", "duration", "detail"],
keys: [ inspect,
"name",
"entryType",
"startTime",
"duration",
"detail",
],
}),
inspectOptions, inspectOptions,
); );
} }
@ -579,14 +549,7 @@ class Performance extends EventTarget {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["timeOrigin"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(PerformancePrototype, this),
keys: ["timeOrigin"],
}),
inspectOptions,
);
} }
} }
webidl.configureInterface(Performance); webidl.configureInterface(Performance);

View file

@ -3,9 +3,8 @@
import { primordials } from "ext:core/mod.js"; import { primordials } from "ext:core/mod.js";
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { DOMException } from "./01_dom_exception.js"; import { DOMException } from "./01_dom_exception.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
const { const {
ObjectPrototypeIsPrototypeOf,
Symbol, Symbol,
SymbolFor, SymbolFor,
TypedArrayPrototypeGetLength, TypedArrayPrototypeGetLength,
@ -198,17 +197,10 @@ class ImageData {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, ["data", "width", "height", "colorSpace"],
evaluate: ObjectPrototypeIsPrototypeOf(ImageDataPrototype, this), inspect,
keys: [
"data",
"width",
"height",
"colorSpace",
],
}),
inspectOptions, inspectOptions,
); );
} }

View file

@ -127,7 +127,7 @@ import {
setEventTargetData, setEventTargetData,
} from "ext:deno_web/02_event.js"; } from "ext:deno_web/02_event.js";
import { DOMException } from "ext:deno_web/01_dom_exception.js"; import { DOMException } from "ext:deno_web/01_dom_exception.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
const _rid = Symbol("[[rid]]"); const _rid = Symbol("[[rid]]");
const _size = Symbol("[[size]]"); const _size = Symbol("[[size]]");
@ -391,7 +391,7 @@ class GPU {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return `${this.constructor.name} ${inspect({}, inspectOptions)}`; return privateInspect(this, [], inspect, inspectOptions);
} }
} }
const GPUPrototype = GPU.prototype; const GPUPrototype = GPU.prototype;
@ -539,17 +539,15 @@ class GPUAdapter {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, [
evaluate: ObjectPrototypeIsPrototypeOf(GPUAdapterPrototype, this),
keys: [
"features", "features",
"limits", "limits",
"info", "info",
"isFallbackAdapter", "isFallbackAdapter",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }
@ -590,17 +588,15 @@ class GPUAdapterInfo {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, [
evaluate: ObjectPrototypeIsPrototypeOf(GPUAdapterInfoPrototype, this),
keys: [
"vendor", "vendor",
"architecture", "architecture",
"device", "device",
"description", "description",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }
@ -773,14 +769,9 @@ class GPUSupportedLimits {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
GPUSupportedLimitsPrototype,
this, this,
), [
keys: [
"maxTextureDimension1D", "maxTextureDimension1D",
"maxTextureDimension2D", "maxTextureDimension2D",
"maxTextureDimension3D", "maxTextureDimension3D",
@ -812,7 +803,7 @@ class GPUSupportedLimits {
"maxComputeWorkgroupSizeZ", "maxComputeWorkgroupSizeZ",
"maxComputeWorkgroupsPerDimension", "maxComputeWorkgroupsPerDimension",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }
@ -881,18 +872,10 @@ class GPUDeviceLostInfo {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
GPUDeviceLostInfoPrototype,
this, this,
), ["reason", "message"],
keys: [ inspect,
"reason",
"message",
],
}),
inspectOptions, inspectOptions,
); );
} }
@ -1831,11 +1814,9 @@ class GPUDevice extends EventTarget {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, [
evaluate: ObjectPrototypeIsPrototypeOf(GPUDevicePrototype, this),
keys: [
"features", "features",
"label", "label",
"limits", "limits",
@ -1844,7 +1825,7 @@ class GPUDevice extends EventTarget {
// TODO(lucacasonato): emit an UncapturedErrorEvent // TODO(lucacasonato): emit an UncapturedErrorEvent
// "onuncapturederror" // "onuncapturederror"
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }
@ -2062,16 +2043,7 @@ class GPUQueue {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["label"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(GPUQueuePrototype, this),
keys: [
"label",
],
}),
inspectOptions,
);
} }
} }
GPUObjectBaseMixin("GPUQueue", GPUQueue); GPUObjectBaseMixin("GPUQueue", GPUQueue);
@ -2373,17 +2345,15 @@ class GPUBuffer {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, [
evaluate: ObjectPrototypeIsPrototypeOf(GPUBufferPrototype, this),
keys: [
"label", "label",
"mapState", "mapState",
"size", "size",
"usage", "usage",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }
@ -2585,11 +2555,9 @@ class GPUTexture {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, [
evaluate: ObjectPrototypeIsPrototypeOf(GPUTexturePrototype, this),
keys: [
"label", "label",
"width", "width",
"height", "height",
@ -2600,7 +2568,7 @@ class GPUTexture {
"format", "format",
"usage", "usage",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }
@ -2664,16 +2632,7 @@ class GPUTextureView {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["label"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(GPUTextureViewPrototype, this),
keys: [
"label",
],
}),
inspectOptions,
);
} }
} }
GPUObjectBaseMixin("GPUTextureView", GPUTextureView); GPUObjectBaseMixin("GPUTextureView", GPUTextureView);
@ -2755,19 +2714,7 @@ class GPUBindGroupLayout {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["label"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
GPUBindGroupLayoutPrototype,
this,
),
keys: [
"label",
],
}),
inspectOptions,
);
} }
} }
GPUObjectBaseMixin("GPUBindGroupLayout", GPUBindGroupLayout); GPUObjectBaseMixin("GPUBindGroupLayout", GPUBindGroupLayout);
@ -2806,23 +2753,10 @@ class GPUPipelineLayout {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["label"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
GPUPipelineLayoutPrototype,
this,
),
keys: [
"label",
],
}),
inspectOptions,
);
} }
} }
GPUObjectBaseMixin("GPUPipelineLayout", GPUPipelineLayout); GPUObjectBaseMixin("GPUPipelineLayout", GPUPipelineLayout);
const GPUPipelineLayoutPrototype = GPUPipelineLayout.prototype;
/** /**
* @param {string | null} label * @param {string | null} label
@ -2858,20 +2792,10 @@ class GPUBindGroup {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["label"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(GPUBindGroupPrototype, this),
keys: [
"label",
],
}),
inspectOptions,
);
} }
} }
GPUObjectBaseMixin("GPUBindGroup", GPUBindGroup); GPUObjectBaseMixin("GPUBindGroup", GPUBindGroup);
const GPUBindGroupPrototype = GPUBindGroup.prototype;
/** /**
* @param {string | null} label * @param {string | null} label
* @param {InnerGPUDevice} device * @param {InnerGPUDevice} device
@ -2906,16 +2830,7 @@ class GPUShaderModule {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["label"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(GPUShaderModulePrototype, this),
keys: [
"label",
],
}),
inspectOptions,
);
} }
} }
GPUObjectBaseMixin("GPUShaderModule", GPUShaderModule); GPUObjectBaseMixin("GPUShaderModule", GPUShaderModule);
@ -3000,19 +2915,7 @@ class GPUComputePipeline {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["label"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
GPUComputePipelinePrototype,
this,
),
keys: [
"label",
],
}),
inspectOptions,
);
} }
} }
GPUObjectBaseMixin("GPUComputePipeline", GPUComputePipeline); GPUObjectBaseMixin("GPUComputePipeline", GPUComputePipeline);
@ -3078,19 +2981,7 @@ class GPURenderPipeline {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["label"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
GPURenderPipelinePrototype,
this,
),
keys: [
"label",
],
}),
inspectOptions,
);
} }
} }
GPUObjectBaseMixin("GPURenderPipeline", GPURenderPipeline); GPUObjectBaseMixin("GPURenderPipeline", GPURenderPipeline);
@ -3799,19 +3690,7 @@ class GPUCommandEncoder {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["label"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
GPUCommandEncoderPrototype,
this,
),
keys: [
"label",
],
}),
inspectOptions,
);
} }
} }
GPUObjectBaseMixin("GPUCommandEncoder", GPUCommandEncoder); GPUObjectBaseMixin("GPUCommandEncoder", GPUCommandEncoder);
@ -4407,19 +4286,7 @@ class GPURenderPassEncoder {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["label"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
GPURenderPassEncoderPrototype,
this,
),
keys: [
"label",
],
}),
inspectOptions,
);
} }
} }
GPUObjectBaseMixin("GPURenderPassEncoder", GPURenderPassEncoder); GPUObjectBaseMixin("GPURenderPassEncoder", GPURenderPassEncoder);
@ -4683,19 +4550,7 @@ class GPUComputePassEncoder {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["label"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
GPUComputePassEncoderPrototype,
this,
),
keys: [
"label",
],
}),
inspectOptions,
);
} }
} }
GPUObjectBaseMixin("GPUComputePassEncoder", GPUComputePassEncoder); GPUObjectBaseMixin("GPUComputePassEncoder", GPUComputePassEncoder);
@ -4736,20 +4591,10 @@ class GPUCommandBuffer {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["label"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(GPUCommandBufferPrototype, this),
keys: [
"label",
],
}),
inspectOptions,
);
} }
} }
GPUObjectBaseMixin("GPUCommandBuffer", GPUCommandBuffer); GPUObjectBaseMixin("GPUCommandBuffer", GPUCommandBuffer);
const GPUCommandBufferPrototype = GPUCommandBuffer.prototype;
/** /**
* @param {string | null} label * @param {string | null} label
@ -5124,19 +4969,7 @@ class GPURenderBundleEncoder {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["label"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(
GPURenderBundleEncoderPrototype,
this,
),
keys: [
"label",
],
}),
inspectOptions,
);
} }
} }
GPUObjectBaseMixin("GPURenderBundleEncoder", GPURenderBundleEncoder); GPUObjectBaseMixin("GPURenderBundleEncoder", GPURenderBundleEncoder);
@ -5177,20 +5010,10 @@ class GPURenderBundle {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["label"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(GPURenderBundlePrototype, this),
keys: [
"label",
],
}),
inspectOptions,
);
} }
} }
GPUObjectBaseMixin("GPURenderBundle", GPURenderBundle); GPUObjectBaseMixin("GPURenderBundle", GPURenderBundle);
const GPURenderBundlePrototype = GPURenderBundle.prototype;
/** /**
* @param {string | null} label * @param {string | null} label
* @param {InnerGPUDevice} device * @param {InnerGPUDevice} device
@ -5248,16 +5071,10 @@ class GPUQuerySet {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, ["label", "type", "count"],
evaluate: ObjectPrototypeIsPrototypeOf(GPUQuerySetPrototype, this), inspect,
keys: [
"label",
"type",
"count",
],
}),
inspectOptions, inspectOptions,
); );
} }

View file

@ -14,14 +14,13 @@ import {
op_webgpu_surface_present, op_webgpu_surface_present,
} from "ext:core/ops"; } from "ext:core/ops";
const { const {
ObjectPrototypeIsPrototypeOf,
Symbol, Symbol,
SymbolFor, SymbolFor,
TypeError, TypeError,
} = primordials; } = primordials;
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import { loadWebGPU } from "ext:deno_webgpu/00_init.js"; import { loadWebGPU } from "ext:deno_webgpu/00_init.js";
const _surfaceRid = Symbol("[[surfaceRid]]"); const _surfaceRid = Symbol("[[surfaceRid]]");
@ -144,16 +143,7 @@ class GPUCanvasContext {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(this, ["canvas"], inspect, inspectOptions);
createFilteredInspectProxy({
object: this,
evaluate: ObjectPrototypeIsPrototypeOf(GPUCanvasContextPrototype, this),
keys: [
"canvas",
],
}),
inspectOptions,
);
} }
} }
const GPUCanvasContextPrototype = GPUCanvasContext.prototype; const GPUCanvasContextPrototype = GPUCanvasContext.prototype;

View file

@ -1138,6 +1138,13 @@ function assertBranded(self, prototype) {
if ( if (
!ObjectPrototypeIsPrototypeOf(prototype, self) || self[brand] !== brand !ObjectPrototypeIsPrototypeOf(prototype, self) || self[brand] !== brand
) { ) {
console.log(
self.toString(),
prototype.toString(),
self === prototype,
self[brand],
brand.toString(),
);
throw new TypeError("Illegal invocation"); throw new TypeError("Illegal invocation");
} }
} }

View file

@ -47,7 +47,7 @@ const {
import { URL } from "ext:deno_url/00_url.js"; import { URL } from "ext:deno_url/00_url.js";
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import { HTTP_TOKEN_CODE_POINT_RE } from "ext:deno_web/00_infra.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 { DOMException } from "ext:deno_web/01_dom_exception.js";
import { clearTimeout, setTimeout } from "ext:deno_web/02_timers.js"; import { clearTimeout, setTimeout } from "ext:deno_web/02_timers.js";
@ -603,11 +603,9 @@ class WebSocket extends EventTarget {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, [
evaluate: ObjectPrototypeIsPrototypeOf(WebSocketPrototype, this),
keys: [
"url", "url",
"readyState", "readyState",
"extensions", "extensions",
@ -619,7 +617,7 @@ class WebSocket extends EventTarget {
"onclose", "onclose",
"onopen", "onopen",
], ],
}), inspect,
inspectOptions, inspectOptions,
); );
} }

View file

@ -33,7 +33,7 @@ const {
} = primordials; } = primordials;
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import { Deferred, writableStreamClose } from "ext:deno_web/06_streams.js"; import { Deferred, writableStreamClose } from "ext:deno_web/06_streams.js";
import { DOMException } from "ext:deno_web/01_dom_exception.js"; import { DOMException } from "ext:deno_web/01_dom_exception.js";
import { add, remove } from "ext:deno_web/03_abort_signal.js"; import { add, remove } from "ext:deno_web/03_abort_signal.js";
@ -426,16 +426,10 @@ class WebSocketStream {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, ["closed", "opened", "url"],
evaluate: ObjectPrototypeIsPrototypeOf(WebSocketStreamPrototype, this), inspect,
keys: [
"closed",
"opened",
"url",
],
}),
inspectOptions, inspectOptions,
); );
} }
@ -505,17 +499,10 @@ class WebSocketError extends DOMException {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, ["message", "name", "closeCode", "reason"],
evaluate: ObjectPrototypeIsPrototypeOf(WebSocketErrorPrototype, this), inspect,
keys: [
"message",
"name",
"closeCode",
"reason",
],
}),
inspectOptions, inspectOptions,
); );
} }

View file

@ -21,7 +21,7 @@ const {
} = primordials; } = primordials;
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import { createFilteredInspectProxy } from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import { URL } from "ext:deno_url/00_url.js"; import { URL } from "ext:deno_url/00_url.js";
import { getLocationHref } from "ext:deno_web/12_location.js"; import { getLocationHref } from "ext:deno_web/12_location.js";
import { serializePermissions } from "ext:runtime/10_permissions.js"; import { serializePermissions } from "ext:runtime/10_permissions.js";
@ -292,16 +292,10 @@ class Worker extends EventTarget {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
createFilteredInspectProxy({ this,
object: this, ["onerror", "onmessage", "onmessageerror"],
evaluate: ObjectPrototypeIsPrototypeOf(WorkerPrototype, this), inspect,
keys: [
"onerror",
"onmessage",
"onmessageerror",
],
}),
inspectOptions, inspectOptions,
); );
} }
@ -309,8 +303,6 @@ class Worker extends EventTarget {
[SymbolToStringTag] = "Worker"; [SymbolToStringTag] = "Worker";
} }
const WorkerPrototype = Worker.prototype;
defineEventHandler(Worker.prototype, "error"); defineEventHandler(Worker.prototype, "error");
defineEventHandler(Worker.prototype, "message"); defineEventHandler(Worker.prototype, "message");
defineEventHandler(Worker.prototype, "messageerror"); defineEventHandler(Worker.prototype, "messageerror");

View file

@ -8,12 +8,11 @@ import {
} from "ext:core/ops"; } from "ext:core/ops";
const { const {
ObjectDefineProperties, ObjectDefineProperties,
ObjectPrototypeIsPrototypeOf,
SymbolFor, SymbolFor,
} = primordials; } = primordials;
import * as location from "ext:deno_web/12_location.js"; import * as location from "ext:deno_web/12_location.js";
import * as console from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import * as globalInterfaces from "ext:deno_web/04_global_interfaces.js"; import * as globalInterfaces from "ext:deno_web/04_global_interfaces.js";
import * as webStorage from "ext:deno_webstorage/01_webstorage.js"; import * as webStorage from "ext:deno_webstorage/01_webstorage.js";
@ -26,17 +25,10 @@ class Navigator {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
console.createFilteredInspectProxy({ this,
object: this, ["hardwareConcurrency", "userAgent", "language", "languages"],
evaluate: ObjectPrototypeIsPrototypeOf(NavigatorPrototype, this), inspect,
keys: [
"hardwareConcurrency",
"userAgent",
"language",
"languages",
],
}),
inspectOptions, inspectOptions,
); );
} }

View file

@ -8,12 +8,11 @@ import {
} from "ext:core/ops"; } from "ext:core/ops";
const { const {
ObjectDefineProperties, ObjectDefineProperties,
ObjectPrototypeIsPrototypeOf,
SymbolFor, SymbolFor,
} = primordials; } = primordials;
import * as location from "ext:deno_web/12_location.js"; import * as location from "ext:deno_web/12_location.js";
import * as console from "ext:deno_console/01_console.js"; import { privateInspect } from "ext:deno_console/01_console.js";
import * as webidl from "ext:deno_webidl/00_webidl.js"; import * as webidl from "ext:deno_webidl/00_webidl.js";
import * as globalInterfaces from "ext:deno_web/04_global_interfaces.js"; import * as globalInterfaces from "ext:deno_web/04_global_interfaces.js";
import { loadWebGPU } from "ext:deno_webgpu/00_init.js"; import { loadWebGPU } from "ext:deno_webgpu/00_init.js";
@ -38,17 +37,10 @@ class WorkerNavigator {
} }
[SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) {
return inspect( return privateInspect(
console.createFilteredInspectProxy({ this,
object: this, ["hardwareConcurrency", "userAgent", "language", "languages"],
evaluate: ObjectPrototypeIsPrototypeOf(WorkerNavigatorPrototype, this), inspect,
keys: [
"hardwareConcurrency",
"userAgent",
"language",
"languages",
],
}),
inspectOptions, inspectOptions,
); );
} }