mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 10:33:54 +00:00
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:
parent
cf893741c3
commit
49eb887cc6
10 changed files with 25 additions and 24 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue