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

padStart/padEnd in current safari is buggy and shouldnt be used #280

Closed
trashhalo opened this issue Feb 8, 2017 · 5 comments
Closed

padStart/padEnd in current safari is buggy and shouldnt be used #280

trashhalo opened this issue Feb 8, 2017 · 5 comments
Labels

Comments

@trashhalo
Copy link

trashhalo commented Feb 8, 2017

The currently released version of safari has a bug in padStart padEnd that causes it to return null.

Fixed a bug where String.prototype.padStart() and padEnd() would insert null in rare cases

https://developer.apple.com/safari/technology-preview/release-notes/ fix in preview 15

While it says its rare we are hitting it about 40% of the time. As far as I can tell there isn't a externally facing way to force a polyfill to override native. Can you guys mark padStart/end as $export.F until this fix lands?

@benjie
Copy link

benjie commented Apr 24, 2017

I was hitting this also on iOS (weirdly it doesn't happen so much when the Developer Tools are connected, but much more when they are not); lost over an hour to finding out what the issue in my code was (not least because I couldn't debug it with the devtools and it was Mobile Safari so I had to resort to alert() based debugging like some kind of Neanderthal).

A buggyfill for this would have saved me a lot of time.

@zloirock
Copy link
Owner

Is forced replacement for /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent) enough, I hope?

@zloirock
Copy link
Owner

Fixed in core-js@2.5.3.

@sunderls
Copy link

sunderls commented Feb 18, 2019

safari: Mozilla/5.0 (iPhone; CPU iPhone OS 10_2 like Mac OS X) AppleWebKit/602.3.12 (KHTML, like Gecko) Version/10.0 Mobile/14C89 Safari/602.1

webview: Mozilla/5.0 (iPhone; CPU iPhone OS 10_2 like Mac OS X) AppleWebKit/602.3.12 (KHTML, like Gecko) Mobile/14C89 Safari

since there is no version string, maybe we better check /iphone os 10/i?

@zloirock
Copy link
Owner

@sunderls it will not work with desktop Safari. Feel free to propose better detection.

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

4 participants