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

Unified Diff: gin/wrappable.cc

Issue 1106393002: gin: Use V8 Maybe APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@maybe-gin-converter
Patch Set: Created 5 years, 8 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
« gin/try_catch.cc ('K') | « gin/try_catch.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/wrappable.cc
diff --git a/gin/wrappable.cc b/gin/wrappable.cc
index 4137609cf917566534cdbe9164e8889b5f59bf55..185c6657f6e674d77cb16cc92efdf92b5b6ff8e7 100644
--- a/gin/wrappable.cc
+++ b/gin/wrappable.cc
@@ -49,10 +49,10 @@ v8::Handle<v8::Object> WrappableBase::GetWrapperImpl(v8::Isolate* isolate,
data->SetObjectTemplate(info, templ);
}
CHECK_EQ(kNumberOfInternalFields, templ->InternalFieldCount());
- v8::Handle<v8::Object> wrapper = templ->NewInstance();
+ v8::Local<v8::Object> wrapper;
// |wrapper| may be empty in some extreme cases, e.g., when
// Object.prototype.constructor is overwritten.
- if (wrapper.IsEmpty()) {
+ if (!templ->NewInstance(isolate->GetCurrentContext()).ToLocal(&wrapper)) {
// The current wrappable object will be no longer managed by V8. Delete this
// now.
delete this;
« gin/try_catch.cc ('K') | « gin/try_catch.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698