diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2023-05-02 19:15:45 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-02 12:15:45 +0200 |
commit | 49eb887cc6325e14211ec4a241ffc4ac98f0f7a9 (patch) | |
tree | 8dec27c42c45b8e0bfaa7d4b886546fbdc942b64 /ext/node | |
parent | cf893741c3206f55eaac1999f50f1018122f7b85 (diff) |
refactor(core): Use `ObjectHasOwn` instead of `ObjectPrototypeHasOwnProperty` (#18952)
ES2022 `Object.hasOwn` can be used in snapshot, so I migrate to use it.
Diffstat (limited to 'ext/node')
-rw-r--r-- | ext/node/polyfills/01_require.js | 4 | ||||
-rw-r--r-- | ext/node/polyfills/internal/child_process.ts | 4 | ||||
-rw-r--r-- | ext/node/polyfills/internal/primordials.mjs | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js index ce7312ee8..c73701ba8 100644 --- a/ext/node/polyfills/01_require.js +++ b/ext/node/polyfills/01_require.js @@ -16,7 +16,7 @@ const { ArrayPrototypeSplice, ObjectGetOwnPropertyDescriptor, ObjectGetPrototypeOf, - ObjectPrototypeHasOwnProperty, + ObjectHasOwn, ObjectSetPrototypeOf, ObjectKeys, ObjectEntries, @@ -433,7 +433,7 @@ const CircularRequirePrototypeWarningProxy = new Proxy({}, { getOwnPropertyDescriptor(target, prop) { if ( - ObjectPrototypeHasOwnProperty(target, prop) || prop === "__esModule" + ObjectHasOwn(target, prop) || prop === "__esModule" ) { return ObjectGetOwnPropertyDescriptor(target, prop); } diff --git a/ext/node/polyfills/internal/child_process.ts b/ext/node/polyfills/internal/child_process.ts index 7c72cb0ca..edc4caa5e 100644 --- a/ext/node/polyfills/internal/child_process.ts +++ b/ext/node/polyfills/internal/child_process.ts @@ -34,7 +34,7 @@ import { ArrayPrototypeSlice, ArrayPrototypeSort, ArrayPrototypeUnshift, - ObjectPrototypeHasOwnProperty, + ObjectHasOwn, StringPrototypeToUpperCase, } from "ext:deno_node/internal/primordials.mjs"; import { kEmptyObject } from "ext:deno_node/internal/util.mjs"; @@ -429,7 +429,7 @@ function copyProcessEnvToEnv( if ( Deno.env.get(name) && (!optionEnv || - !ObjectPrototypeHasOwnProperty(optionEnv, name)) + !ObjectHasOwn(optionEnv, name)) ) { env[name] = Deno.env.get(name); } diff --git a/ext/node/polyfills/internal/primordials.mjs b/ext/node/polyfills/internal/primordials.mjs index 1639efdb5..8127eebac 100644 --- a/ext/node/polyfills/internal/primordials.mjs +++ b/ext/node/polyfills/internal/primordials.mjs @@ -12,7 +12,7 @@ export const ArrayPrototypeSort = (that, ...args) => that.sort(...args); export const ArrayPrototypeUnshift = (that, ...args) => that.unshift(...args); export const ObjectAssign = Object.assign; export const ObjectCreate = Object.create; -export const ObjectPrototypeHasOwnProperty = Object.hasOwn; +export const ObjectHasOwn = Object.hasOwn; export const RegExpPrototypeTest = (that, ...args) => that.test(...args); export const RegExpPrototypeExec = RegExp.prototype.exec; export const StringFromCharCode = String.fromCharCode; |