summaryrefslogtreecommitdiff
path: root/ext/webidl/00_webidl.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/webidl/00_webidl.js')
-rw-r--r--ext/webidl/00_webidl.js28
1 files changed, 17 insertions, 11 deletions
diff --git a/ext/webidl/00_webidl.js b/ext/webidl/00_webidl.js
index a532c5ac4..c3b00286f 100644
--- a/ext/webidl/00_webidl.js
+++ b/ext/webidl/00_webidl.js
@@ -1138,36 +1138,42 @@ function mixinPairIterable(name, prototype, dataSymbol, keyKey, valueKey) {
return ObjectDefineProperties(prototype.prototype, properties);
}
-function configurePrototype(prototype) {
- const descriptors = ObjectGetOwnPropertyDescriptors(prototype.prototype);
+function configureInterface(interface_) {
+ configureProperties(interface_);
+ configureProperties(interface_.prototype);
+ ObjectDefineProperty(interface_.prototype, SymbolToStringTag, {
+ value: interface_.name,
+ enumerable: false,
+ configurable: true,
+ writable: false,
+ });
+}
+
+function configureProperties(obj) {
+ const descriptors = ObjectGetOwnPropertyDescriptors(obj);
for (const key in descriptors) {
if (!ObjectHasOwn(descriptors, key)) {
continue;
}
if (key === "constructor") continue;
+ if (key === "prototype") continue;
const descriptor = descriptors[key];
if (
ReflectHas(descriptor, "value") &&
typeof descriptor.value === "function"
) {
- ObjectDefineProperty(prototype.prototype, key, {
+ ObjectDefineProperty(obj, key, {
enumerable: true,
writable: true,
configurable: true,
});
} else if (ReflectHas(descriptor, "get")) {
- ObjectDefineProperty(prototype.prototype, key, {
+ ObjectDefineProperty(obj, key, {
enumerable: true,
configurable: true,
});
}
}
- ObjectDefineProperty(prototype.prototype, SymbolToStringTag, {
- value: prototype.name,
- enumerable: false,
- configurable: true,
- writable: false,
- });
}
const setlikeInner = Symbol("[[set]]");
@@ -1275,7 +1281,7 @@ function setlike(obj, objPrototype, readonly) {
export {
assertBranded,
brand,
- configurePrototype,
+ configureInterface,
converters,
createBranded,
createDictionaryConverter,