summaryrefslogtreecommitdiff
path: root/src/string_bytes.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/string_bytes.cc')
-rw-r--r--src/string_bytes.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/string_bytes.cc b/src/string_bytes.cc
index a916caf75e..d9ca6e565e 100644
--- a/src/string_bytes.cc
+++ b/src/string_bytes.cc
@@ -368,7 +368,6 @@ size_t StringBytes::Write(Isolate* isolate,
switch (encoding) {
case ASCII:
case BINARY:
- case BUFFER:
if (is_extern && str->IsOneByte()) {
memcpy(buf, data, nbytes);
} else {
@@ -379,6 +378,7 @@ size_t StringBytes::Write(Isolate* isolate,
*chars_written = nbytes;
break;
+ case BUFFER:
case UTF8:
nbytes = str->WriteUtf8(buf, buflen, chars_written, flags);
break;
@@ -480,11 +480,11 @@ size_t StringBytes::StorageSize(Isolate* isolate,
switch (encoding) {
case BINARY:
- case BUFFER:
case ASCII:
data_size = str->Length();
break;
+ case BUFFER:
case UTF8:
// A single UCS2 codepoint never takes up more than 3 utf8 bytes.
// It is an exercise for the caller to decide when a string is
@@ -532,11 +532,11 @@ size_t StringBytes::Size(Isolate* isolate,
switch (encoding) {
case BINARY:
- case BUFFER:
case ASCII:
data_size = str->Length();
break;
+ case BUFFER:
case UTF8:
data_size = str->Utf8Length();
break;