summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'extensions')
-rw-r--r--extensions/console/02_console.js22
-rw-r--r--extensions/fetch/20_headers.js2
-rw-r--r--extensions/url/00_url.js2
-rw-r--r--extensions/web/02_event.js12
-rw-r--r--extensions/web/06_streams.js8
-rw-r--r--extensions/web/12_location.js4
-rw-r--r--extensions/webgpu/01_webgpu.js48
7 files changed, 49 insertions, 49 deletions
diff --git a/extensions/console/02_console.js b/extensions/console/02_console.js
index 3391b520b..ddfcbf47a 100644
--- a/extensions/console/02_console.js
+++ b/extensions/console/02_console.js
@@ -203,7 +203,7 @@
function inspectFunction(value, level, inspectOptions) {
const cyan = maybeColor(colors.cyan, inspectOptions);
if (customInspect in value && typeof value[customInspect] === "function") {
- return String(value[customInspect]());
+ return String(value[customInspect](inspect));
}
// Might be Function/AsyncFunction/GeneratorFunction/AsyncGeneratorFunction
let cstrName = Object.getPrototypeOf(value)?.constructor?.name;
@@ -901,22 +901,22 @@
inspectOptions,
) {
if (customInspect in value && typeof value[customInspect] === "function") {
- return String(value[customInspect]());
+ return String(value[customInspect](inspect));
}
- // This non-unique symbol is used to support extensions, ie.
- // in extensions/web we don't want to depend on unique "Deno.customInspect"
- // symbol defined in the public API. Internal only, shouldn't be used
- // by users.
- const nonUniqueCustomInspect = Symbol.for("Deno.customInspect");
+ // This non-unique symbol is used to support op_crates, ie.
+ // in extensions/web we don't want to depend on public
+ // Symbol.for("Deno.customInspect") symbol defined in the public API.
+ // Internal only, shouldn't be used by users.
+ const privateCustomInspect = Symbol.for("Deno.privateCustomInspect");
if (
- nonUniqueCustomInspect in value &&
- typeof value[nonUniqueCustomInspect] === "function"
+ privateCustomInspect in value &&
+ typeof value[privateCustomInspect] === "function"
) {
// TODO(nayeemrmn): `inspect` is passed as an argument because custom
// inspect implementations in `extensions` need it, but may not have access
// to the `Deno` namespace in web workers. Remove when the `Deno`
// namespace is always enabled.
- return String(value[nonUniqueCustomInspect](inspect));
+ return String(value[privateCustomInspect](inspect));
}
if (value instanceof Error) {
return String(value.stack);
@@ -1760,7 +1760,7 @@
}
}
- const customInspect = Symbol("Deno.customInspect");
+ const customInspect = Symbol.for("Deno.customInspect");
function inspect(
value,
diff --git a/extensions/fetch/20_headers.js b/extensions/fetch/20_headers.js
index 26500b602..59f81a8ff 100644
--- a/extensions/fetch/20_headers.js
+++ b/extensions/fetch/20_headers.js
@@ -370,7 +370,7 @@
}
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
const headers = {};
for (const header of this) {
headers[header[0]] = header[1];
diff --git a/extensions/url/00_url.js b/extensions/url/00_url.js
index 2daae8d45..7b1c6e06a 100644
--- a/extensions/url/00_url.js
+++ b/extensions/url/00_url.js
@@ -222,7 +222,7 @@
this[_url] = parts;
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
const object = {
href: this.href,
origin: this.origin,
diff --git a/extensions/web/02_event.js b/extensions/web/02_event.js
index 7a270881f..081869efd 100644
--- a/extensions/web/02_event.js
+++ b/extensions/web/02_event.js
@@ -143,7 +143,7 @@
});
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return inspect(buildFilteredPropertyInspectObject(this, EVENT_PROPS));
}
@@ -1055,7 +1055,7 @@
return "ErrorEvent";
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return inspect(buildFilteredPropertyInspectObject(this, [
...EVENT_PROPS,
"message",
@@ -1109,7 +1109,7 @@
this.#reason = reason;
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return inspect(buildFilteredPropertyInspectObject(this, [
...EVENT_PROPS,
"wasClean",
@@ -1137,7 +1137,7 @@
this.lastEventId = eventInitDict?.lastEventId ?? "";
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return inspect(buildFilteredPropertyInspectObject(this, [
...EVENT_PROPS,
"data",
@@ -1167,7 +1167,7 @@
return "CustomEvent";
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return inspect(buildFilteredPropertyInspectObject(this, [
...EVENT_PROPS,
"detail",
@@ -1190,7 +1190,7 @@
this.total = eventInitDict?.total ?? 0;
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return inspect(buildFilteredPropertyInspectObject(this, [
...EVENT_PROPS,
"lengthComputable",
diff --git a/extensions/web/06_streams.js b/extensions/web/06_streams.js
index 127436d43..d26a1a412 100644
--- a/extensions/web/06_streams.js
+++ b/extensions/web/06_streams.js
@@ -3304,7 +3304,7 @@
return iterator;
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${inspect({ locked: this.locked })}`;
}
@@ -3424,7 +3424,7 @@
return readableStreamReaderGenericCancel(this, reason);
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${inspect({ closed: this.closed })}`;
}
@@ -3821,7 +3821,7 @@
return this[_writable];
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({ readable: this.readable, writable: this.writable })
}`;
@@ -4022,7 +4022,7 @@
return acquireWritableStreamDefaultWriter(this);
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${inspect({ locked: this.locked })}`;
}
diff --git a/extensions/web/12_location.js b/extensions/web/12_location.js
index 2b6580f8b..75012396a 100644
--- a/extensions/web/12_location.js
+++ b/extensions/web/12_location.js
@@ -165,7 +165,7 @@
},
enumerable: true,
},
- [Symbol.for("Deno.customInspect")]: {
+ [Symbol.for("Deno.privateCustomInspect")]: {
value: function (inspect) {
const object = {
hash: this.hash,
@@ -322,7 +322,7 @@
value: "WorkerLocation",
configurable: true,
},
- [Symbol.for("Deno.customInspect")]: {
+ [Symbol.for("Deno.privateCustomInspect")]: {
value: function (inspect) {
const object = {
hash: this.hash,
diff --git a/extensions/webgpu/01_webgpu.js b/extensions/webgpu/01_webgpu.js
index 23beaf1cc..5ff6cde46 100644
--- a/extensions/webgpu/01_webgpu.js
+++ b/extensions/webgpu/01_webgpu.js
@@ -167,7 +167,7 @@
}
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${inspect({})}`;
}
}
@@ -271,7 +271,7 @@
);
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
name: this.name,
@@ -388,7 +388,7 @@
return this[_limits].maxVertexBufferArrayStride;
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${inspect(this[_limits])}`;
}
}
@@ -451,7 +451,7 @@
return this[_features][Symbol.iterator]();
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${inspect([...this.values()])}`;
}
}
@@ -492,7 +492,7 @@
return this[_message];
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({ reason: this[_reason], message: this[_message] })
}`;
@@ -1292,7 +1292,7 @@
return scope.error ?? null;
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
features: this.features,
@@ -1478,7 +1478,7 @@
throw new Error("Not yet implemented");
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -1793,7 +1793,7 @@
this[_cleanup]();
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -1932,7 +1932,7 @@
this[_cleanup]();
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -1999,7 +1999,7 @@
webidl.illegalConstructor();
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -2042,7 +2042,7 @@
webidl.illegalConstructor();
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -2085,7 +2085,7 @@
webidl.illegalConstructor();
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -2128,7 +2128,7 @@
webidl.illegalConstructor();
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -2171,7 +2171,7 @@
webidl.illegalConstructor();
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -2218,7 +2218,7 @@
throw new Error("Not yet implemented");
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -2312,7 +2312,7 @@
return bindGroupLayout;
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -2387,7 +2387,7 @@
return bindGroupLayout;
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -3150,7 +3150,7 @@
return commandBuffer;
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -3966,7 +3966,7 @@
});
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -4369,7 +4369,7 @@
});
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -4417,7 +4417,7 @@
throw new Error("Not yet implemented");
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -4873,7 +4873,7 @@
throw new Error("Not yet implemented");
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -4917,7 +4917,7 @@
webidl.illegalConstructor();
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,
@@ -4971,7 +4971,7 @@
this[_cleanup]();
}
- [Symbol.for("Deno.customInspect")](inspect) {
+ [Symbol.for("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${
inspect({
label: this.label,