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 #677
  • Loading branch information
zloirock committed Oct 24, 2019
1 parent 34a8a4d commit b7d2a2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,5 +1,6 @@
## Changelog
##### Unreleased
- Added a workaround for V8 `Array#{ splice, filter, map }` deoptimization which causes 100x+ performance degradation of those methods, [#677](https://github.com/zloirock/core-js/issues/677)
- 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
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 b7d2a2d

Please sign in to comment.