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

Unified Diff: src/handles.h

Issue 223573002: Return MaybeHandle from NewRaw???String. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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.cc ('k') | src/json-parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles.h
diff --git a/src/handles.h b/src/handles.h
index 77e5e528da6e2fa04ea7386fe6ff00bd79394401..5b5ed1b564bd57e2648edfb35d74f2832026ecd8 100644
--- a/src/handles.h
+++ b/src/handles.h
@@ -72,7 +72,8 @@ class MaybeHandle {
return Handle<T>(location_);
}
- INLINE(bool ToHandle(Handle<T>* out)) {
+ // Convert to a Handle with a type that can be upcasted to.
+ template <class S> INLINE(bool ToHandle(Handle<S>* out)) {
if (location_ == NULL) {
*out = Handle<T>::null();
return false;
@@ -82,6 +83,8 @@ class MaybeHandle {
}
}
+ bool is_null() const { return location_ == NULL; }
+
protected:
T** location_;
« no previous file with comments | « src/factory.cc ('k') | src/json-parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698