Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 52a194180be30b9c675b83ef45d7ce06f137f45e..543c1b5f7dc1ccf1868ec9b433d8e1fbbf65c93f 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -334,8 +334,8 @@ Handle<ConsString> Factory::NewRawConsString(String::Encoding encoding) { |
} |
-Handle<String> Factory::NewConsString(Handle<String> left, |
- Handle<String> right) { |
+MaybeHandle<String> Factory::NewConsString(Handle<String> left, |
+ Handle<String> right) { |
int left_length = left->length(); |
if (left_length == 0) return right; |
int right_length = right->length(); |
@@ -352,8 +352,8 @@ Handle<String> Factory::NewConsString(Handle<String> left, |
// Make sure that an out of memory exception is thrown if the length |
// of the new cons string is too large. |
if (length > String::kMaxLength || length < 0) { |
- isolate()->ThrowInvalidStringLength(); |
- return Handle<String>::null(); |
+ return isolate()->Throw<String>( |
+ isolate()->factory()->NewInvalidStringLengthError()); |
} |
bool left_is_one_byte = left->IsOneByteRepresentation(); |