Skip to content

Commit

Permalink
add a workaround for V8 Array#{ splice, filter, map } deoptimizatio…
Browse files Browse the repository at this point in the history
…n which causes 100x+ performance degradation of those methods, close #624
  • Loading branch information
zloirock committed Oct 24, 2019
1 parent 34a8a4d commit 9720739
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 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
- Added a workaround for V8 `Array#{ splice, filter, map }` deoptimization which causes 100x+ performance degradation of those methods, [#624](https://github.com/zloirock/core-js/issues/624)
- Fixed work of `fetch` with polyfilled `URLSearchParams`, [#674](https://github.com/zloirock/core-js/issues/674)
- `package-lock.json` no longer generated in libraries

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ var SPECIES = wellKnownSymbol('species');

module.exports = function (METHOD_NAME) {
return !fails(function () {
var array = [];
var constructor = array.constructor = {};
var object = {};
var constructor = object.constructor = {};
constructor[SPECIES] = function () {
return { foo: 1 };
};
return array[METHOD_NAME](Boolean).foo !== 1;
return [][METHOD_NAME].call(object, Boolean).foo !== 1;
});
};

0 comments on commit 9720739

Please sign in to comment.