Skip to content

Commit 0784656

Browse files
committedJul 29, 2021
IE10 fix
1 parent 6245936 commit 0784656

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎packages/core-js/internals/array-group-by.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
var bind = require('../internals/function-bind-context');
2-
var has = require('../internals/has');
32
var IndexedObject = require('../internals/indexed-object');
43
var toObject = require('../internals/to-object');
54
var toLength = require('../internals/to-length');
@@ -20,7 +19,9 @@ module.exports = function ($this, callbackfn, that, specificConstructor) {
2019
for (;length > index; index++) {
2120
value = self[index];
2221
key = toPropertyKey(boundFunction(value, index, O));
23-
if (has(target, key)) push.call(target[key], value);
22+
// in some IE10 builds, `hasOwnProperty` returns incorrect result on integer keys
23+
// but since it's a `null` prototype object, we can safely use `in`
24+
if (key in target) push.call(target[key], value);
2425
else target[key] = [value];
2526
}
2627
if (specificConstructor) {

0 commit comments

Comments
 (0)
Please sign in to comment.