Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: src/factory.cc

Issue 223383002: Return MaybeHandle from NewConsString. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comment Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.h ('k') | src/func-name-inferrer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « src/factory.h ('k') | src/func-name-inferrer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698