src: fix external string length calculation
authorBen Noordhuis <info@bnoordhuis.nl>
Tue, 3 Mar 2015 13:46:16 +0000 (14:46 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Thu, 5 Mar 2015 19:44:19 +0000 (20:44 +0100)
commit2eda2d609658826c559fca1944b0e6aafb9d1344
treef11dccb20c748ca1fabaee5b7c376585d61af042
parente2fb733a951a51821c03cf83400607522da52e44
src: fix external string length calculation

Make StringBytes::GetExternalParts() return the byte length for two-byte
strings, not the character length.  Its callers operate on bytes, not
characters.

This also fixes StringBytes::Size() reporting only half of the actual
number of bytes for external two-byte strings.

PR-URL: https://github.com/iojs/io.js/pull/1042
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
src/string_bytes.cc