refactor(core): Use ObjectHasOwn instead of ObjectPrototypeHasOwnProperty (#18952)

ES2022 `Object.hasOwn` can be used in snapshot, so I migrate to use it.
This commit is contained in:
Kenta Moriuchi 2023-05-02 19:15:45 +09:00 committed by GitHub
parent cf893741c3
commit 49eb887cc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 25 additions and 24 deletions

View file

@ -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;