refactor: replace Object.prototype.hasOwnProperty() with Object.hasOwn() (#38929)
This commit is contained in:
parent
09669f9d21
commit
607e71d563
11 changed files with 13 additions and 17 deletions
|
@ -1312,7 +1312,6 @@ describe('asar package', function () {
|
|||
itremote('can promisify all fs functions', function () {
|
||||
const originalFs = require('original-fs');
|
||||
const util = require('node:util');
|
||||
const { hasOwnProperty } = Object.prototype;
|
||||
|
||||
for (const [propertyName, originalValue] of Object.entries(originalFs)) {
|
||||
// Some properties exist but have a value of `undefined` on some platforms.
|
||||
|
@ -1321,7 +1320,7 @@ describe('asar package', function () {
|
|||
// Also check for `null`s, `hasOwnProperty()` can't handle them.
|
||||
if (typeof originalValue === 'undefined' || originalValue === null) continue;
|
||||
|
||||
if (hasOwnProperty.call(originalValue, util.promisify.custom)) {
|
||||
if (Object.hasOwn(originalValue, util.promisify.custom)) {
|
||||
expect(fs).to.have.own.property(propertyName)
|
||||
.that.has.own.property(util.promisify.custom);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue