summaryrefslogtreecommitdiff
path: root/ext/web/02_event.js
diff options
context:
space:
mode:
author李瑞丰 <li15227870916@gmail.com>2021-09-25 01:07:22 +0800
committerGitHub <noreply@github.com>2021-09-25 02:07:22 +0900
commit46245b830a24930ab36f8ce2831325cdd1da17d3 (patch)
treec96c2a69a30120d2cdf639b72a3bace836417151 /ext/web/02_event.js
parent9705efd419ffa05b0d88e788e0ceb77e38078449 (diff)
fix(ext/webidl): correctly apply [SymbolToStringTag] to interfaces (#11851)
Co-authored-by: Luca Casonato <hello@lcas.dev> Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Diffstat (limited to 'ext/web/02_event.js')
-rw-r--r--ext/web/02_event.js29
1 files changed, 17 insertions, 12 deletions
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");