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

Unified Diff: src/api.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 | « no previous file | src/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 34a431d9b748846dc38768cb2298e1b75b45e30c..6808e418655edc5cd07abaafec744dbb1b7d4c1a 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -5459,10 +5459,9 @@ Local<String> v8::String::Concat(Handle<String> left, Handle<String> right) {
LOG_API(isolate, "String::New(char)");
ENTER_V8(isolate);
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 fail. Change this if it does.
- CHECK(!result.is_null());
+ i::Handle<i::String> result = isolate->factory()->NewConsString(
+ left_string, right_string).ToHandleChecked();
return Utils::ToLocal(result);
}
@@ -7019,15 +7018,15 @@ Handle<String> CpuProfileNode::GetFunctionName() const {
i::Isolate* isolate = i::Isolate::Current();
const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this);
const i::CodeEntry* entry = node->entry();
+ i::Handle<i::String> name =
+ isolate->factory()->InternalizeUtf8String(entry->name());
if (!entry->has_name_prefix()) {
- return ToApiHandle<String>(
- isolate->factory()->InternalizeUtf8String(entry->name()));
+ return ToApiHandle<String>(name);
} else {
+ // We do not expect this to fail. Change this if it does.
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 fail. Change this if it does.
- CHECK(!cons.is_null());
+ name).ToHandleChecked();
return ToApiHandle<String>(cons);
}
}
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698