summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-05-13 04:28:59 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-05-13 04:40:14 +0200
commit7349667467f5acf9897513236b6bfba0111a53cf (patch)
treec09a180067f30ea8ba5cfa89e12cd6587b694c60
parent0c405cff684dfd7a30f18faa5e56f3ffce746137 (diff)
downloadnode-new-7349667467f5acf9897513236b6bfba0111a53cf.tar.gz
stream_wrap: MayContainNonAscii() is deprecated
V8 3.19.0 deprecates v8::String::MayContainNonAscii(). It always returns true so there is not much point in keeping the call site around.
-rw-r--r--src/stream_wrap.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc
index 04b08814ce..ba79fa7f3c 100644
--- a/src/stream_wrap.cc
+++ b/src/stream_wrap.cc
@@ -355,11 +355,7 @@ size_t StreamWrap::GetStringSizeImpl(Handle<Value> val) {
break;
case kUtf8:
- if (!(string->MayContainNonAscii())) {
- // If the string has only ascii characters, we know exactly how big
- // the storage should be.
- return string->Length();
- } else if (string->Length() < 65536) {
+ if (string->Length() < 65536) {
// A single UCS2 codepoint never takes up more than 3 utf8 bytes.
// Unless the string is really long we just allocate so much space that
// we're certain the string fits in there entirely.
@@ -368,7 +364,7 @@ size_t StreamWrap::GetStringSizeImpl(Handle<Value> val) {
} else {
// The string is really long. Compute the allocation size that we
// actually need.
- return string->Utf8Length();
+ return string->Utf8Length();
}
break;