Skip to content

Commit

Permalink
Exclude polyfill for ES2016 [].includes() sparse array issue
Browse files Browse the repository at this point in the history
Although this polyfill is required for bug-free `[].includes()` in legacy Firefox versions with sparse arrays, we don’t have any:

```
The es-shims polyfill added the following polyfills:
  Array.prototype.includes { "firefox":"60" }
```
  • Loading branch information
colinrotherham committed Dec 11, 2023
1 parent 68c76c7 commit 7fbe825
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/govuk-frontend/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ module.exports = function (api) {

// Browser support polyfills to exclude
exclude: [
// ES2016 '[].includes()' sparse array fix is unnecessary
// https://bugzilla.mozilla.org/show_bug.cgi?id=1767541
// https://github.com/zloirock/core-js/commit/66be5f0b673714bc7cc72a3b5e437fe277465973
'Array.prototype.includes',

// ES2022 Error cause is unused
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause
'Error cause'
Expand Down

0 comments on commit 7fbe825

Please sign in to comment.