summaryrefslogtreecommitdiff
path: root/src/string_bytes.cc
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-04-07 20:36:33 +0800
committerRuben Bridgewater <ruben@bridgewater.de>2018-04-10 01:08:10 +0200
commit362694401fc08f1eb312417487bfc2d3c9281a6e (patch)
tree0922c3b51834356953d886141348bd180027a742 /src/string_bytes.cc
parent5b8c62c60d63a0da00da20823ce6fed7039036a7 (diff)
downloadandroid-node-v8-362694401fc08f1eb312417487bfc2d3c9281a6e.tar.gz
android-node-v8-362694401fc08f1eb312417487bfc2d3c9281a6e.tar.bz2
android-node-v8-362694401fc08f1eb312417487bfc2d3c9281a6e.zip
src: rename ERR_STRING_TOO_LARGE to ERR_STRING_TOO_LONG
The old error name and message were trying to be consistent with ERR_BUFFER_TOO_LARGE but they were not really accurate. The kStringMaxLength was measured in number of characters, not number of bytes. The name ERR_STRING_TOO_LARGE also seems a bit awkward. This patch tries to correct them before they get released to users. PR-URL: https://github.com/nodejs/node/pull/19864 Refs: https://github.com/nodejs/node/pull/19739 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Diffstat (limited to 'src/string_bytes.cc')
-rw-r--r--src/string_bytes.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/string_bytes.cc b/src/string_bytes.cc
index bbd381d33a..0bc2ec044e 100644
--- a/src/string_bytes.cc
+++ b/src/string_bytes.cc
@@ -113,7 +113,7 @@ class ExternString: public ResourceType {
if (str.IsEmpty()) {
delete h_str;
- *error = node::ERR_STRING_TOO_LARGE(isolate);
+ *error = node::ERR_STRING_TOO_LONG(isolate);
return MaybeLocal<Value>();
}
@@ -170,7 +170,7 @@ MaybeLocal<Value> ExternOneByteString::NewSimpleFromCopy(Isolate* isolate,
v8::NewStringType::kNormal,
length);
if (str.IsEmpty()) {
- *error = node::ERR_STRING_TOO_LARGE(isolate);
+ *error = node::ERR_STRING_TOO_LONG(isolate);
return MaybeLocal<Value>();
}
return str.ToLocalChecked();
@@ -188,7 +188,7 @@ MaybeLocal<Value> ExternTwoByteString::NewSimpleFromCopy(Isolate* isolate,
v8::NewStringType::kNormal,
length);
if (str.IsEmpty()) {
- *error = node::ERR_STRING_TOO_LARGE(isolate);
+ *error = node::ERR_STRING_TOO_LONG(isolate);
return MaybeLocal<Value>();
}
return str.ToLocalChecked();
@@ -657,7 +657,7 @@ MaybeLocal<Value> StringBytes::Encode(Isolate* isolate,
v8::NewStringType::kNormal,
buflen);
if (val.IsEmpty()) {
- *error = node::ERR_STRING_TOO_LARGE(isolate);
+ *error = node::ERR_STRING_TOO_LONG(isolate);
return MaybeLocal<Value>();
}
return val.ToLocalChecked();