Commit 2af96b3
Return ASCII strings from String.prototype.concat when possible
Summary:
`String.prototype.concat` is returning a UTF16 string always. this is
because the call to `StringBuilder::createStringBuilder` defaults to
UTF16. Instead, we can make the choice more accurately: if all arguments
(including `this`) to `concat` are ASCII, then make an ASCII string.
Otherwise, make a UTF16 string.
Reviewed By: avp
Differential Revision: D83851016
fbshipit-source-id: f46de6154052f50c55c18a9832a9260b7800ac281 parent de05551 commit 2af96b3
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
| 846 | + | |
| 847 | + | |
846 | 848 | | |
847 | 849 | | |
848 | 850 | | |
| |||
859 | 861 | | |
860 | 862 | | |
861 | 863 | | |
| 864 | + | |
862 | 865 | | |
863 | 866 | | |
864 | 867 | | |
| |||
868 | 871 | | |
869 | 872 | | |
870 | 873 | | |
871 | | - | |
| 874 | + | |
872 | 875 | | |
873 | 876 | | |
874 | 877 | | |
| |||
0 commit comments