Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex exec problems in simulated IE8 #920

Closed
IanVS opened this issue Mar 25, 2021 · 1 comment
Closed

Regex exec problems in simulated IE8 #920

IanVS opened this issue Mar 25, 2021 · 1 comment
Labels

Comments

@IanVS
Copy link

IanVS commented Mar 25, 2021

I've hit a strange problem while trying to add useBuiltins: 'usage' to an app that is forced to support IE8 as well as newer IE in IE8 compatibility mode. I have multiple webpack entrypoints that get loaded on a single page (I know that's weird, but it's been working that way for a long time). When I try to add core-js via babel, I find that the regex polyfill is running twice, and it seems to assume that it's only ever going to run one time. Specifically, I'm referring to this line:

var nativeReplace = String.prototype.replace;
nativeReplace is assumed to always be native, and seemingly because of this assumption, IE8 in compat mode enters an infinite loop and runs out of memory down here:
nativeReplace.call(match[0], reCopy, function () {
if it has already been polyfilled. I'm not sure why, but it seems to be okay in real IE8. For now I'm going to work on preventing this from being called twice, but I wanted to at least open the issue in case it warrants a look. Thanks!

@IanVS
Copy link
Author

IanVS commented Mar 30, 2021

Thanks a ton for addressing this so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants