Skip to content

Commit e3fffb7

Browse files
authored
Merge pull request #695 from welkinwong/fix-lib-hasown-lagacy
🐛 Fix hasOwn function implementation to ensure proper property checking
2 parents a0c1f9d + 0baf4ee commit e3fffb7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/util.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ exports.hasKeys = function(object) {
99
};
1010

1111
var hasOwn;
12-
exports.hasOwn = hasOwn = Object.hasOwn || Object.prototype.hasOwnProperty.call;
12+
exports.hasOwn = hasOwn = Object.hasOwn || function(obj, prop) {
13+
return Object.prototype.hasOwnProperty.call(obj, prop);
14+
};
1315

1416
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger#Polyfill
1517
exports.isInteger = Number.isInteger || function(value) {

0 commit comments

Comments
 (0)