Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index b1d133abf916290f8c35078b0138431478350f71..3f63f13e89c826d048a5d2ac6f59af76a57ea439 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -5429,6 +5429,8 @@ inline Local<String> NewString(Isolate* v8_isolate, |
if (length == -1) length = StringLength(data); |
i::Handle<i::String> result = NewString( |
isolate->factory(), type, i::Vector<const Char>(data, length)); |
+ // We do not expect this to fail. Change this if it does. |
+ CHECK(!result.is_null()); |
if (type == String::kUndetectableString) { |
result->MarkAsUndetectable(); |
} |
@@ -5486,8 +5488,8 @@ Local<String> v8::String::Concat(Handle<String> left, Handle<String> right) { |
i::Handle<i::String> right_string = Utils::OpenHandle(*right); |
i::Handle<i::String> result = isolate->factory()->NewConsString(left_string, |
right_string); |
- // We do not expect this to throw an exception. Change this if it does. |
- CHECK_NOT_EMPTY_HANDLE(isolate, result); |
+ // We do not expect this to fail. Change this if it does. |
+ CHECK(!result.is_null()); |
return Utils::ToLocal(result); |
} |
@@ -5495,14 +5497,22 @@ Local<String> v8::String::Concat(Handle<String> left, Handle<String> right) { |
static i::Handle<i::String> NewExternalStringHandle( |
i::Isolate* isolate, |
v8::String::ExternalStringResource* resource) { |
- return isolate->factory()->NewExternalStringFromTwoByte(resource); |
+ i::Handle<i::String> result = |
+ isolate->factory()->NewExternalStringFromTwoByte(resource); |
+ // We do not expect this to fail. Change this if it does. |
+ CHECK(!result.is_null()); |
+ return result; |
} |
static i::Handle<i::String> NewExternalAsciiStringHandle( |
i::Isolate* isolate, |
v8::String::ExternalAsciiStringResource* resource) { |
- return isolate->factory()->NewExternalStringFromAscii(resource); |
+ i::Handle<i::String> result = |
+ isolate->factory()->NewExternalStringFromAscii(resource); |
+ // We do not expect this to fail. Change this if it does. |
+ CHECK(!result.is_null()); |
+ return result; |
} |
@@ -6156,6 +6166,8 @@ Local<Symbol> v8::Symbol::New(Isolate* isolate, const char* data, int length) { |
if (length == -1) length = i::StrLength(data); |
i::Handle<i::String> name = i_isolate->factory()->NewStringFromUtf8( |
i::Vector<const char>(data, length)); |
+ // We do not expect this to fail. Change this if it does. |
+ CHECK(!name.is_null()); |
result->set_name(*name); |
} |
return Utils::ToLocal(result); |
@@ -6977,8 +6989,8 @@ Handle<String> CpuProfileNode::GetFunctionName() const { |
i::Handle<i::String> cons = isolate->factory()->NewConsString( |
isolate->factory()->InternalizeUtf8String(entry->name_prefix()), |
isolate->factory()->InternalizeUtf8String(entry->name())); |
- // We do not expect this to throw an exception. Change this if it does. |
- CHECK_NOT_EMPTY_HANDLE(isolate, cons); |
+ // We do not expect this to fail. Change this if it does. |
+ CHECK(!cons.is_null()); |
return ToApiHandle<String>(cons); |
} |
} |