From bece2eb1b4e4206ac07c62d75c457effd93eb491 Mon Sep 17 00:00:00 2001 From: Steven Levithan Date: Tue, 27 Oct 2020 17:20:32 -0400 Subject: [PATCH] Work around core-js 3.6.0 incomplete sticky polyfill --- src/xregexp.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/xregexp.js b/src/xregexp.js index f879a256..b7f1e1ad 100644 --- a/src/xregexp.js +++ b/src/xregexp.js @@ -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