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
{{ message }}
This repository has been archived by the owner on May 9, 2019. It is now read-only.
I had a look to the implementation selected by latest versions of ECMA for padStart. They chose to consider code points outside the BMP plan as two distinct characters.
With padStart on Chrome and Firefox I get the following:
If the choice of left-pad is to be compliant with padStart then the only way to handle this case would be to solve the issue of the third argument not accepting multiple characters.
Otherwise if the choice is leftPad on code points (and not code units) the fix consists in measuring the size of the input string by by-passing String.length and measuring the length manually (only characters in the range \ud800 to \udfff can be by pairs). Then the pad code will be the same.
There is an inconsistency when padding strings containg unicode characters out of BMP plan (ie. code points encoded on two chars in UTF-16).
You should maybe specify that left-pad does not handle code points out of BMP plan as single characters.
Failure found using property based testing:
https://runkit.com/dubzzz/5ab9f3d8cc861f0012852eff
The text was updated successfully, but these errors were encountered: