Repository navigation
Commit 698815c
committed
[JSC] Return written bytes in JSStringGetUTF8CString when it encounters invalid source
https://bugs.webkit.org/show_bug.cgi?id=278587
rdar://133747399
Reviewed by Yijia Huang.
As API document describes, we should return written bytes even when we encountered the invalid source (like, unpaired surrogate) and stopped
conversion in the middle of the string.
* Source/JavaScriptCore/API/JSStringRef.cpp:
(JSStringGetUTF8CString):
* Source/JavaScriptCore/API/tests/testapi.c:
(checkJSStringInvalid):
(main):
Canonical link: https://commits.webkit.org/282689@main1 parent ea5e661 commit 698815c
2 files changed
Lines changed: 26 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | 107 | | |
111 | 108 | | |
112 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1303 | 1303 | | |
1304 | 1304 | | |
1305 | 1305 | | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
1306 | 1331 | | |
1307 | 1332 | | |
1308 | 1333 | | |
| |||
1888 | 1913 | | |
1889 | 1914 | | |
1890 | 1915 | | |
| 1916 | + | |
1891 | 1917 | | |
1892 | 1918 | | |
1893 | 1919 | | |
| |||
0 commit comments