(str)
| 1021 | // Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte. |
| 1022 | |
| 1023 | function lengthBytesUTF32(str) { |
| 1024 | var len = 0; |
| 1025 | for (var i = 0; i < str.length; ++i) { |
| 1026 | // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap. |
| 1027 | // See http://unicode.org/faq/utf_bom.html#utf16-3 |
| 1028 | var codeUnit = str.charCodeAt(i); |
| 1029 | if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) ++i; // possibly a lead surrogate, so skip over the tail surrogate. |
| 1030 | len += 4; |
| 1031 | } |
| 1032 | |
| 1033 | return len; |
| 1034 | } |
| 1035 | |
| 1036 | |
| 1037 | function demangle(func) { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…