From 9d8251be9f3377bf1eb398c832a96bae171c572d Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Sun, 15 Dec 2024 18:05:02 +0100 Subject: [PATCH] Disable `prefer-object-has-own`, it is not compatible with Node v14.18.0 --- config/eslint.js | 2 +- src/internal/reflection.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/eslint.js b/config/eslint.js index b55dafdb9..ae50151ec 100644 --- a/config/eslint.js +++ b/config/eslint.js @@ -731,7 +731,7 @@ export default [ "prefer-exponentiation-operator": ["error"], "prefer-named-capture-group": ["off"], "prefer-numeric-literals": ["error"], - "prefer-object-has-own": ["error"], + "prefer-object-has-own": ["off"], "prefer-object-spread": ["error"], "prefer-promise-reject-errors": ["error"], "prefer-regex-literals": ["error"], diff --git a/src/internal/reflection.js b/src/internal/reflection.js index c84307836..fdfb929e2 100644 --- a/src/internal/reflection.js +++ b/src/internal/reflection.js @@ -39,7 +39,7 @@ const typeofString = "string"; * @returns {boolean} `true` if property is an own-property, `false` otherwise. */ export function hasOwn(object, property) { - return Object.hasOwn(object, property); + return Object.prototype.hasOwnProperty.call(object, property); } /**