From f0a3d206422af3177e0f36ed22802c1ccc6f7654 Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Fri, 6 Sep 2024 19:52:59 +0900 Subject: 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 Co-authored-by: Luca Casonato --- ext/webidl/00_webidl.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ext/webidl/00_webidl.js') 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, -- cgit v1.2.3