Skip to content

Commit

Permalink
fix work of new %TypedArray% methods on BigInt arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Dec 6, 2020
1 parent caf5949 commit 78a9a24
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Changelog
##### Unreleased
- Fixed work of new `%TypedArray%` methods on `BigInt` arrays
- Added ESNext methods to ES3 workaround for `Number` constructor wrapper

##### 3.8.0 - 2020.11.26
Expand Down
14 changes: 12 additions & 2 deletions packages/core-js/internals/array-buffer-view-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,23 @@ var TypedArrayConstructorsList = {
Float64Array: 8
};

var BigIntArrayConstructorsList = {
BigInt64Array: 8,
BigUint64Array: 8
};

var isView = function isView(it) {
var klass = classof(it);
return klass === 'DataView' || has(TypedArrayConstructorsList, klass);
return klass === 'DataView'
|| has(TypedArrayConstructorsList, klass)
|| has(BigIntArrayConstructorsList, klass);
};

var isTypedArray = function (it) {
return isObject(it) && has(TypedArrayConstructorsList, classof(it));
return isObject(it) && (
has(TypedArrayConstructorsList, classof(it)) ||
has(BigIntArrayConstructorsList, classof(it))
);
};

var aTypedArray = function (it) {
Expand Down

0 comments on commit 78a9a24

Please sign in to comment.