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

es.string.replace-all not being polyfilled in Node v14 LTS #978

Closed
joealden opened this issue Aug 24, 2021 · 1 comment
Closed

es.string.replace-all not being polyfilled in Node v14 LTS #978

joealden opened this issue Aug 24, 2021 · 1 comment

Comments

@joealden
Copy link

From looking at https://node.green/#ES2021-features--String-prototype-replaceAll, string.prototype.replaceAll is not supported in the latest version of the current LTS release (14.17.x), meaning that I believe core-js should polyfill this when using @babel/preset-env with a targets option of { node: "14.15.0" } and a corejs option of 3.16.2? From my testing, this is currently not the case. Please let me know if you cannot reproduce this yourself, and I'll try to provide a minimal case.

I believe these two sections of code are relevant to this problem:

'es.string.replace-all': {
chrome: '85',
firefox: '77',
safari: '13.1',
},

[84, '14.6'],
[86, '15.0'],

As 85 isn't defined in the ChromeToNode mapping, I'm wondering what happens in this case? Does it (or is it supposed to) interpolate between the values that are defined for values that are not defined, meaning that 85 should map to 15.0 in this case? If not, then I guess to resolve this problem, we'd need to define an 85 mapping?

@joealden joealden changed the title string.prototype.replaceAll not being polyfilled in Node v14.17.5 es.string.replace-all not being polyfilled in Node v14 LTS Aug 24, 2021
@zloirock
Copy link
Owner

zloirock commented Aug 24, 2021

On core-js side all fine. It's a babel issue. Seems they should update built-ins definitions. They find the same problem an hour ago babel/website#2569 (comment), babel/babel#13701.

Please, report it to https://github.com/babel/babel-polyfills repo.

You could try to set proposals: true option as a temporal fix - most likely it will help.

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

No branches or pull requests

2 participants