summaryrefslogtreecommitdiff
path: root/ext/web
diff options
context:
space:
mode:
Diffstat (limited to 'ext/web')
-rw-r--r--ext/web/01_dom_exception.js5
-rw-r--r--ext/web/02_event.js29
-rw-r--r--ext/web/03_abort_signal.js9
-rw-r--r--ext/web/06_streams.js45
-rw-r--r--ext/web/08_text_encoding.js17
-rw-r--r--ext/web/09_file.js9
-rw-r--r--ext/web/10_filereader.js5
-rw-r--r--ext/web/13_message_port.js9
8 files changed, 17 insertions, 111 deletions
diff --git a/ext/web/01_dom_exception.js b/ext/web/01_dom_exception.js
index 0d9e82c56..ae478da2b 100644
--- a/ext/web/01_dom_exception.js
+++ b/ext/web/01_dom_exception.js
@@ -18,7 +18,6 @@
ObjectEntries,
ObjectSetPrototypeOf,
SymbolFor,
- SymbolToStringTag,
} = window.__bootstrap.primordials;
const webidl = window.__bootstrap.webidl;
const consoleInternal = window.__bootstrap.console;
@@ -120,10 +119,6 @@
return this.#code;
}
- get [SymbolToStringTag]() {
- return "DOMException";
- }
-
[SymbolFor("Deno.customInspect")](inspect) {
if (this instanceof DOMException) {
return `DOMException: ${this.#message}`;
diff --git a/ext/web/02_event.js b/ext/web/02_event.js
index c61f0955d..f54e3d8a3 100644
--- a/ext/web/02_event.js
+++ b/ext/web/02_event.js
@@ -395,6 +395,9 @@
get timeStamp() {
return this[_attributes].timeStamp;
}
+
+ // TODO(lucacasonato): remove when this interface is spec aligned
+ [SymbolToStringTag] = "Event";
}
function defineEnumerableProps(
@@ -988,15 +991,13 @@
return dispatch(self, event);
}
- get [SymbolToStringTag]() {
- return "EventTarget";
- }
-
getParent(_event) {
return null;
}
}
+ webidl.configurePrototype(EventTarget);
+
defineEnumerableProps(EventTarget, [
"addEventListener",
"removeEventListener",
@@ -1052,10 +1053,6 @@
this.#error = error;
}
- get [SymbolToStringTag]() {
- return "ErrorEvent";
- }
-
[SymbolFor("Deno.privateCustomInspect")](inspect) {
return inspect(consoleInternal.createFilteredInspectProxy({
object: this,
@@ -1070,6 +1067,9 @@
],
}));
}
+
+ // TODO(lucacasonato): remove when this interface is spec aligned
+ [SymbolToStringTag] = "ErrorEvent";
}
defineEnumerableProps(ErrorEvent, [
@@ -1158,6 +1158,9 @@
],
}));
}
+
+ // TODO(lucacasonato): remove when this interface is spec aligned
+ [SymbolToStringTag] = "CloseEvent";
}
class CustomEvent extends Event {
@@ -1176,10 +1179,6 @@
return this.#detail;
}
- get [SymbolToStringTag]() {
- return "CustomEvent";
- }
-
[SymbolFor("Deno.privateCustomInspect")](inspect) {
return inspect(consoleInternal.createFilteredInspectProxy({
object: this,
@@ -1190,6 +1189,9 @@
],
}));
}
+
+ // TODO(lucacasonato): remove when this interface is spec aligned
+ [SymbolToStringTag] = "CustomEvent";
}
ReflectDefineProperty(CustomEvent.prototype, "detail", {
@@ -1219,6 +1221,9 @@
],
}));
}
+
+ // TODO(lucacasonato): remove when this interface is spec aligned
+ [SymbolToStringTag] = "ProgressEvent";
}
const _eventHandlers = Symbol("eventHandlers");
diff --git a/ext/web/03_abort_signal.js b/ext/web/03_abort_signal.js
index 511ad216f..98f14f47a 100644
--- a/ext/web/03_abort_signal.js
+++ b/ext/web/03_abort_signal.js
@@ -13,7 +13,6 @@
SetPrototypeAdd,
SetPrototypeDelete,
Symbol,
- SymbolToStringTag,
TypeError,
} = window.__bootstrap.primordials;
@@ -72,10 +71,6 @@
get aborted() {
return Boolean(this[aborted]);
}
-
- get [SymbolToStringTag]() {
- return "AbortSignal";
- }
}
defineEventHandler(AbortSignal.prototype, "abort");
@@ -91,10 +86,6 @@
abort() {
this.#signal[signalAbort]();
}
-
- get [SymbolToStringTag]() {
- return "AbortController";
- }
}
webidl.configurePrototype(AbortController);
diff --git a/ext/web/06_streams.js b/ext/web/06_streams.js
index 4199be6e0..d062f7fbc 100644
--- a/ext/web/06_streams.js
+++ b/ext/web/06_streams.js
@@ -31,7 +31,6 @@
Symbol,
SymbolAsyncIterator,
SymbolFor,
- SymbolToStringTag,
TypeError,
Uint8Array,
WeakMap,
@@ -3031,10 +3030,6 @@
],
}));
}
-
- get [SymbolToStringTag]() {
- return "ByteLengthQueuingStrategy";
- }
}
webidl.configurePrototype(ByteLengthQueuingStrategy);
@@ -3087,10 +3082,6 @@
],
}));
}
-
- get [SymbolToStringTag]() {
- return "CountQueuingStrategy";
- }
}
webidl.configurePrototype(CountQueuingStrategy);
@@ -3339,10 +3330,6 @@
[SymbolFor("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${inspect({ locked: this.locked })}`;
}
-
- get [SymbolToStringTag]() {
- return "ReadableStream";
- }
}
// TODO(lucacasonato): should be moved to webidl crate
@@ -3459,10 +3446,6 @@
[SymbolFor("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${inspect({ closed: this.closed })}`;
}
-
- get [SymbolToStringTag]() {
- return "ReadableStreamDefaultReader";
- }
}
webidl.configurePrototype(ReadableStreamDefaultReader);
@@ -3582,10 +3565,6 @@
}));
}
- get [SymbolToStringTag]() {
- return "ReadableByteStreamController";
- }
-
/**
* @param {any} reason
* @returns {Promise<void>}
@@ -3707,10 +3686,6 @@
}));
}
- get [SymbolToStringTag]() {
- return "ReadableStreamDefaultController";
- }
-
/**
* @param {any} reason
* @returns {Promise<void>}
@@ -3861,10 +3836,6 @@
inspect({ readable: this.readable, writable: this.writable })
}`;
}
-
- get [SymbolToStringTag]() {
- return "TransformStream";
- }
}
webidl.configurePrototype(TransformStream);
@@ -3928,10 +3899,6 @@
keys: ["desiredSize"],
}));
}
-
- get [SymbolToStringTag]() {
- return "TransformStreamDefaultController";
- }
}
webidl.configurePrototype(TransformStreamDefaultController);
@@ -4062,10 +4029,6 @@
[SymbolFor("Deno.privateCustomInspect")](inspect) {
return `${this.constructor.name} ${inspect({ locked: this.locked })}`;
}
-
- get [SymbolToStringTag]() {
- return "WritableStream";
- }
}
webidl.configurePrototype(WritableStream);
@@ -4211,10 +4174,6 @@
],
}));
}
-
- get [SymbolToStringTag]() {
- return "WritableStreamDefaultWriter";
- }
}
webidl.configurePrototype(WritableStreamDefaultWriter);
@@ -4268,10 +4227,6 @@
}));
}
- get [SymbolToStringTag]() {
- return "WritableStreamDefaultController";
- }
-
/**
* @param {any=} reason
* @returns {Promise<void>}
diff --git a/ext/web/08_text_encoding.js b/ext/web/08_text_encoding.js
index e37fbdcd7..28f2848b8 100644
--- a/ext/web/08_text_encoding.js
+++ b/ext/web/08_text_encoding.js
@@ -20,7 +20,6 @@
PromiseResolve,
StringPrototypeCharCodeAt,
StringPrototypeSlice,
- SymbolToStringTag,
TypedArrayPrototypeSubarray,
TypedArrayPrototypeSlice,
Uint8Array,
@@ -126,10 +125,6 @@
}
}
}
-
- get [SymbolToStringTag]() {
- return "TextDecoder";
- }
}
webidl.configurePrototype(TextDecoder);
@@ -182,10 +177,6 @@
});
return core.opSync("op_encoding_encode_into", source, destination);
}
-
- get [SymbolToStringTag]() {
- return "TextEncoder";
- }
}
webidl.configurePrototype(TextEncoder);
@@ -272,10 +263,6 @@
webidl.assertBranded(this, TextDecoderStream);
return this.#transform.writable;
}
-
- get [SymbolToStringTag]() {
- return "TextDecoderStream";
- }
}
webidl.configurePrototype(TextDecoderStream);
@@ -345,10 +332,6 @@
webidl.assertBranded(this, TextEncoderStream);
return this.#transform.writable;
}
-
- get [SymbolToStringTag]() {
- return "TextEncoderStream";
- }
}
webidl.configurePrototype(TextEncoderStream);
diff --git a/ext/web/09_file.js b/ext/web/09_file.js
index 64cdb7b8a..6681f7a13 100644
--- a/ext/web/09_file.js
+++ b/ext/web/09_file.js
@@ -30,7 +30,6 @@
Symbol,
SymbolFor,
TypedArrayPrototypeSet,
- SymbolToStringTag,
TypeError,
Uint8Array,
} = window.__bootstrap.primordials;
@@ -359,10 +358,6 @@
return bytes.buffer;
}
- get [SymbolToStringTag]() {
- return "Blob";
- }
-
[SymbolFor("Deno.customInspect")](inspect) {
return inspect(consoleInternal.createFilteredInspectProxy({
object: this,
@@ -472,10 +467,6 @@
webidl.assertBranded(this, File);
return this[_LastModified];
}
-
- get [SymbolToStringTag]() {
- return "File";
- }
}
webidl.configurePrototype(File);
diff --git a/ext/web/10_filereader.js b/ext/web/10_filereader.js
index f93eb5fee..56794d8b8 100644
--- a/ext/web/10_filereader.js
+++ b/ext/web/10_filereader.js
@@ -31,7 +31,6 @@
queueMicrotask,
StringFromCodePoint,
Symbol,
- SymbolToStringTag,
TypedArrayPrototypeSet,
TypeError,
Uint8Array,
@@ -44,10 +43,6 @@
const handlerSymbol = Symbol("eventHandlers");
class FileReader extends EventTarget {
- get [SymbolToStringTag]() {
- return "FileReader";
- }
-
/** @type {"empty" | "loading" | "done"} */
[state] = "empty";
/** @type {null | string | ArrayBuffer} */
diff --git a/ext/web/13_message_port.js b/ext/web/13_message_port.js
index 2768c0a92..c02b373d6 100644
--- a/ext/web/13_message_port.js
+++ b/ext/web/13_message_port.js
@@ -22,7 +22,6 @@
ObjectSetPrototypeOf,
Symbol,
SymbolFor,
- SymbolToStringTag,
TypeError,
WeakSet,
WeakSetPrototypeAdd,
@@ -59,10 +58,6 @@
inspect({ port1: this.port1, port2: this.port2 })
}`;
}
-
- get [SymbolToStringTag]() {
- return "MessageChannel";
- }
}
webidl.configurePrototype(MessageChannel);
@@ -174,10 +169,6 @@
this[_id] = null;
}
}
-
- get [SymbolToStringTag]() {
- return "MessagePort";
- }
}
defineEventHandler(MessagePort.prototype, "message", function (self) {