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

Unified Diff: src/api.h

Issue 962983002: Convert v8::Value::To* to use MaybeLocal (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 | « include/v8config.h ('k') | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.h
diff --git a/src/api.h b/src/api.h
index ee0765e78c3ef987048b6a284dd6bcbc0b8e29ef..fa8682bf572079558491ee7cba95e44e55ea73b3 100644
--- a/src/api.h
+++ b/src/api.h
@@ -319,6 +319,18 @@ inline v8::Local<T> ToApiHandle(
}
+template <class T>
+inline bool ToLocal(v8::internal::MaybeHandle<v8::internal::Object> maybe,
+ Local<T>* local) {
+ v8::internal::Handle<v8::internal::Object> handle;
+ if (maybe.ToHandle(&handle)) {
+ *local = Utils::Convert<v8::internal::Object, T>(handle);
+ return true;
+ }
+ return false;
+}
+
+
// Implementations of ToLocal
#define MAKE_TO_LOCAL(Name, From, To) \
« no previous file with comments | « include/v8config.h ('k') | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698