diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-18 09:30:45 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-22 01:06:20 +0200 |
commit | 055f71f87d5d58be2aafd6c0ef2b84d57ed48b63 (patch) | |
tree | 71f5f12e997bdcca340309cd5da81aacf0b3731f /src/qml/jsruntime/qv4global_p.h | |
parent | 2d781c4ca42f50643fa37200073a2fb2644b3806 (diff) |
Introduce a Referenced<T> class to pass Objects into methods
Added some convenience typedefs (StringRef, ObjectRef, ReturnedString,
ScopedString, ...)
Used StringRef in newBuiltinFunction() for testing.
Cleaned up the duplicated code for thrower functions.
Change-Id: I7b7676690cbe70d9eabb0a5afd0d922f0be3aefd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4global_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4global_p.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h index 389468cc39..9f963f345b 100644 --- a/src/qml/jsruntime/qv4global_p.h +++ b/src/qml/jsruntime/qv4global_p.h @@ -105,11 +105,22 @@ struct QObjectWrapper; // will return it in a register on all platforms. // It will be returned in rax on x64, [eax,edx] on x86 and [r0,r1] on arm typedef quint64 ReturnedValue; -template<typename T> struct Scoped; -template<typename T> struct Returned; struct CallData; struct ScopedValue; struct ValueRef; +template<typename T> struct Scoped; +typedef Scoped<String> ScopedString; +typedef Scoped<Object> ScopedObject; +typedef Scoped<FunctionObject> ScopedFunctionObject; +template<typename T> struct Returned; +typedef Returned<String> ReturnedString; +typedef Returned<Object> ReturnedObject; +typedef Returned<FunctionObject> ReturnedFunctionObject; +template<typename T> struct Referenced; +typedef Referenced<String> StringRef; +typedef Referenced<Object> ObjectRef; +typedef Referenced<FunctionObject> FunctionObjectRef; + namespace Global { enum { |