diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2024-09-06 19:52:59 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-06 12:52:59 +0200 |
commit | f0a3d206422af3177e0f36ed22802c1ccc6f7654 (patch) | |
tree | 57ad718cc47b7b98c0bbd869d6c070adee3bf30a /ext/webidl | |
parent | 8ef08f1d294dbe7e3771202084ecbede73ca28aa (diff) |
fix(runtime): use more null proto objects again (#25040)
proceed with #23921
This PR is a preparation for
https://github.com/denoland/deno_lint/pull/1307
---------
Signed-off-by: Kenta Moriuchi <moriken@kimamass.com>
Co-authored-by: Luca Casonato <hello@lcas.dev>
Diffstat (limited to 'ext/webidl')
-rw-r--r-- | ext/webidl/00_webidl.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/webidl/00_webidl.js b/ext/webidl/00_webidl.js index 36fc89ce2..f23c9b7dd 100644 --- a/ext/webidl/00_webidl.js +++ b/ext/webidl/00_webidl.js @@ -753,6 +753,7 @@ function createDictionaryConverter(name, ...dictionaries) { defaultValues[member.key] = member.converter(idlMemberValue, {}); } else { ObjectDefineProperty(defaultValues, member.key, { + __proto__: null, get() { return member.converter(idlMemberValue, member.defaultValue); }, @@ -1076,6 +1077,7 @@ function mixinPairIterable(name, prototype, dataSymbol, keyKey, valueKey) { function createDefaultIterator(target, kind) { const iterator = ObjectCreate(iteratorPrototype); ObjectDefineProperty(iterator, _iteratorInternal, { + __proto__: null, value: { target, kind, index: 0 }, configurable: true, }); @@ -1149,6 +1151,7 @@ function configureInterface(interface_) { configureProperties(interface_); configureProperties(interface_.prototype); ObjectDefineProperty(interface_.prototype, SymbolToStringTag, { + __proto__: null, value: interface_.name, enumerable: false, configurable: true, @@ -1170,12 +1173,14 @@ function configureProperties(obj) { typeof descriptor.value === "function" ) { ObjectDefineProperty(obj, key, { + __proto__: null, enumerable: true, writable: true, configurable: true, }); } else if (ReflectHas(descriptor, "get")) { ObjectDefineProperty(obj, key, { + __proto__: null, enumerable: true, configurable: true, }); @@ -1189,6 +1194,7 @@ const setlikeInner = Symbol("[[set]]"); function setlike(obj, objPrototype, readonly) { ObjectDefineProperties(obj, { size: { + __proto__: null, configurable: true, enumerable: true, get() { @@ -1197,6 +1203,7 @@ function setlike(obj, objPrototype, readonly) { }, }, [SymbolIterator]: { + __proto__: null, configurable: true, enumerable: false, writable: true, @@ -1206,6 +1213,7 @@ function setlike(obj, objPrototype, readonly) { }, }, entries: { + __proto__: null, configurable: true, enumerable: true, writable: true, @@ -1215,6 +1223,7 @@ function setlike(obj, objPrototype, readonly) { }, }, keys: { + __proto__: null, configurable: true, enumerable: true, writable: true, @@ -1224,6 +1233,7 @@ function setlike(obj, objPrototype, readonly) { }, }, values: { + __proto__: null, configurable: true, enumerable: true, writable: true, @@ -1233,6 +1243,7 @@ function setlike(obj, objPrototype, readonly) { }, }, forEach: { + __proto__: null, configurable: true, enumerable: true, writable: true, @@ -1242,6 +1253,7 @@ function setlike(obj, objPrototype, readonly) { }, }, has: { + __proto__: null, configurable: true, enumerable: true, writable: true, @@ -1255,6 +1267,7 @@ function setlike(obj, objPrototype, readonly) { if (!readonly) { ObjectDefineProperties(obj, { add: { + __proto__: null, configurable: true, enumerable: true, writable: true, @@ -1264,6 +1277,7 @@ function setlike(obj, objPrototype, readonly) { }, }, delete: { + __proto__: null, configurable: true, enumerable: true, writable: true, @@ -1273,6 +1287,7 @@ function setlike(obj, objPrototype, readonly) { }, }, clear: { + __proto__: null, configurable: true, enumerable: true, writable: true, |