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

Unified Diff: include/v8.h

Issue 16206014: Add Persistent::Upcast. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 7 years, 6 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 | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 5526705c84269523ab7eafd144ab26dd12aa594e..b2203ec9ca1afacba24ce873ecfb619bdc2ed82a 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -1469,6 +1469,8 @@ class V8EXPORT Value : public Data {
bool Equals(Handle<Value> that) const;
bool StrictEquals(Handle<Value> that) const;
+ template <class T> V8_INLINE(static Value* Cast(T* value));
+
private:
V8_INLINE(bool QuickIsUndefined() const);
V8_INLINE(bool QuickIsNull() const);
@@ -5987,6 +5989,11 @@ bool Value::QuickIsString() const {
}
+template <class T> Value* Value::Cast(T* value) {
+ return static_cast<Value*>(value);
+}
+
+
Symbol* Symbol::Cast(v8::Value* value) {
#ifdef V8_ENABLE_CHECKS
CheckCast(value);
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698