diff options
author | isaacs <i@izs.me> | 2012-03-28 19:51:38 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-03-28 19:51:38 -0700 |
commit | 4b64542fe09477fc5c70e974eb1a78cdce755eb7 (patch) | |
tree | b4d4cdfd5b07efbdae51098b422fde7844ff4715 /deps/v8/src/unicode.cc | |
parent | 8a15147bc53849417f8737dd873877d497867c9f (diff) | |
download | node-4b64542fe09477fc5c70e974eb1a78cdce755eb7.tar.gz |
Upgrade V8 to 3.9.24.6
Diffstat (limited to 'deps/v8/src/unicode.cc')
-rw-r--r-- | deps/v8/src/unicode.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/deps/v8/src/unicode.cc b/deps/v8/src/unicode.cc index 61c649f5e..14f380642 100644 --- a/deps/v8/src/unicode.cc +++ b/deps/v8/src/unicode.cc @@ -276,6 +276,7 @@ uchar Utf8::CalculateValue(const byte* str, return kBadChar; } + const byte* Utf8::ReadBlock(Buffer<const char*> str, byte* buffer, unsigned capacity, unsigned* chars_read_ptr, unsigned* offset_ptr) { unsigned offset = *offset_ptr; @@ -338,6 +339,16 @@ unsigned CharacterStream::Length() { return result; } +unsigned CharacterStream::Utf16Length() { + unsigned result = 0; + while (has_more()) { + uchar c = GetNext(); + result += c > Utf16::kMaxNonSurrogateCharCode ? 2 : 1; + } + Rewind(); + return result; +} + void CharacterStream::Seek(unsigned position) { Rewind(); for (unsigned i = 0; i < position; i++) { |