(s string)
| 341 | } |
| 342 | |
| 343 | func DecodeJSStringRune(s string) (rune, int) { |
| 344 | if len(s) >= 3 && |
| 345 | s[0] == surrogateUTF8Lead && |
| 346 | s[1] >= surrogateUTF8Byte1Min && s[1] <= surrogateUTF8Byte1Max && |
| 347 | s[2] >= utf8ContMarker && s[2] <= utf8ContMax { |
| 348 | return surrogateUTF8LeadBits | rune(s[1]&utf8ContMask)<<6 | rune(s[2]&utf8ContMask), 3 |
| 349 | } |
| 350 | return utf8.DecodeRuneInString(s) |
| 351 | } |
| 352 | |
| 353 | // CombineSurrogatePairs canonicalizes a JS-string value produced by |
| 354 | // concatenation, merging any adjacent high+low surrogate sentinel pair (as |
no test coverage detected