Skip to content

Commit

Permalink
Work around core-js 3.6.0 incomplete sticky polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
slevithan committed Oct 27, 2020
1 parent 95eeebe commit bece2eb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/xregexp.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ function hasNativeFlag(flag) {
} catch (exception) {
isSupported = false;
}
// Work around a broken/incomplete IE11 polyfill for sticky introduced in core-js 3.6.0
if (flag === 'y') {
const incompleteY = '.a'.replace(new RegExp('a', 'gy'), '.') === '..';
if (incompleteY) {
isSupported = false;
}
}
return isSupported;
}
// Check for ES6 `u` flag support
Expand Down

0 comments on commit bece2eb

Please sign in to comment.