You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several places in code, where are workarounds for IE misunderstanding of some regexp flags:
internals/regexp-sticky-helpers.js for flag 'y';
internals/regexp-unsupported-dot-all.js for flag 's';
internals/regexp-unsupported-ncg.js for flag 'g'.
Workarounds are like:
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,varRE=function(s,f){returnRegExp(s,f);};exports.UNSUPPORTED_Y=fails(function(){varre=RE('a','y');re.lastIndex=2;returnre.exec('abcd')!=null;});
and
module.exports=fails(function(){// babel-minify transpiles RegExp('.', 's') -> /./s and it causes SyntaxErrorvarre=RegExp('.',(typeof'').charAt(0));return!(re.dotAll&&re.exec('\n')&&re.flags==='s');});
That could work fine with Babel, but Google Closure Compiler cannot be fooled like that. It understands such tricks, and still compiles code into failing regexps.
That could be prevented by using "@noinline" flag, like this:
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,/** @noinline */varRE=function(s,f){returnRegExp(s,f);};
in all 3 places.
The text was updated successfully, but these errors were encountered:
Thanks for the issue. However, such directives-comments will not work if you will pass already minified core-js with removed comments to Closure Compiler - that confuses me.
Yes, thats a small problem. But if one uses google closure compiler, there are no point to compile minified files. Its better to use source files, to get useful source maps.
There are several places in code, where are workarounds for IE misunderstanding of some regexp flags:
Workarounds are like:
and
That could work fine with Babel, but Google Closure Compiler cannot be fooled like that. It understands such tricks, and still compiles code into failing regexps.
That could be prevented by using "@noinline" flag, like this:
in all 3 places.
The text was updated successfully, but these errors were encountered: