From 49eb887cc6325e14211ec4a241ffc4ac98f0f7a9 Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Tue, 2 May 2023 19:15:45 +0900 Subject: refactor(core): Use `ObjectHasOwn` instead of `ObjectPrototypeHasOwnProperty` (#18952) ES2022 `Object.hasOwn` can be used in snapshot, so I migrate to use it. --- ext/webidl/00_webidl.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/webidl') diff --git a/ext/webidl/00_webidl.js b/ext/webidl/00_webidl.js index 71b7982b7..247ebfe0d 100644 --- a/ext/webidl/00_webidl.js +++ b/ext/webidl/00_webidl.js @@ -47,7 +47,7 @@ const { ObjectGetOwnPropertyDescriptor, ObjectGetOwnPropertyDescriptors, ObjectGetPrototypeOf, - ObjectPrototypeHasOwnProperty, + ObjectHasOwn, ObjectPrototypeIsPrototypeOf, ObjectIs, PromisePrototypeThen, @@ -920,7 +920,7 @@ function createRecordConverter(keyConverter, valueConverter) { // Fast path for common case (not a Proxy) if (!core.isProxy(V)) { for (const key in V) { - if (!ObjectPrototypeHasOwnProperty(V, key)) { + if (!ObjectHasOwn(V, key)) { continue; } const typedKey = keyConverter(key, prefix, context, opts); @@ -1133,7 +1133,7 @@ function mixinPairIterable(name, prototype, dataSymbol, keyKey, valueKey) { function configurePrototype(prototype) { const descriptors = ObjectGetOwnPropertyDescriptors(prototype.prototype); for (const key in descriptors) { - if (!ObjectPrototypeHasOwnProperty(descriptors, key)) { + if (!ObjectHasOwn(descriptors, key)) { continue; } if (key === "constructor") continue; -- cgit v1.2.3