diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-13 14:11:55 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 13:14:03 +0200 |
commit | 49aead7f236f8b8a6ab85adc4b5eace1c1e4dde6 (patch) | |
tree | 21b01c30b568bd79176a5dfe4ec2437e2545660e /src/qml/jsruntime/qv4errorobject_p.h | |
parent | 2a43ec129a544d80c9cc3266b5eccce0f6ba66ef (diff) |
Extend the ReturnedValue mechanism to pointers to Managed objects
Add a Returned<T> that we can return instead of raw pointers
to Managed objects.
Start using the Returned<T> for a few methods.
Also clean up all our classes to use the Q_MANAGED macro instead
of manually defining their vtable.
Change-Id: I0a2962e47f3de955cd2cd8474f8f3fcc9e36d084
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4errorobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4errorobject_p.h | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/src/qml/jsruntime/qv4errorobject_p.h b/src/qml/jsruntime/qv4errorobject_p.h index d16057b035..73d9362a6d 100644 --- a/src/qml/jsruntime/qv4errorobject_p.h +++ b/src/qml/jsruntime/qv4errorobject_p.h @@ -93,11 +93,9 @@ struct ReferenceErrorObject: ErrorObject { }; struct SyntaxErrorObject: ErrorObject { + Q_MANAGED SyntaxErrorObject(ExecutionEngine *engine, const Value &msg); SyntaxErrorObject(ExecutionEngine *engine, const QString &msg, const QString &fileName, int lineNumber, int columnNumber); - -protected: - static const ManagedVTable static_vtbl; }; struct TypeErrorObject: ErrorObject { @@ -111,74 +109,60 @@ struct URIErrorObject: ErrorObject { struct ErrorCtor: FunctionObject { + Q_MANAGED ErrorCtor(ExecutionContext *scope); ErrorCtor(ExecutionContext *scope, String *name); static ReturnedValue construct(Managed *, CallData *callData); static ReturnedValue call(Managed *that, CallData *callData); - -protected: - static const ManagedVTable static_vtbl; }; struct EvalErrorCtor: ErrorCtor { + Q_MANAGED EvalErrorCtor(ExecutionContext *scope); static ReturnedValue construct(Managed *m, CallData *callData); - -protected: - static const ManagedVTable static_vtbl; }; struct RangeErrorCtor: ErrorCtor { + Q_MANAGED RangeErrorCtor(ExecutionContext *scope); static ReturnedValue construct(Managed *m, CallData *callData); - -protected: - static const ManagedVTable static_vtbl; }; struct ReferenceErrorCtor: ErrorCtor { + Q_MANAGED ReferenceErrorCtor(ExecutionContext *scope); static ReturnedValue construct(Managed *m, CallData *callData); - -protected: - static const ManagedVTable static_vtbl; }; struct SyntaxErrorCtor: ErrorCtor { + Q_MANAGED SyntaxErrorCtor(ExecutionContext *scope); static ReturnedValue construct(Managed *m, CallData *callData); - -protected: - static const ManagedVTable static_vtbl; }; struct TypeErrorCtor: ErrorCtor { + Q_MANAGED TypeErrorCtor(ExecutionContext *scope); static ReturnedValue construct(Managed *m, CallData *callData); - -protected: - static const ManagedVTable static_vtbl; }; struct URIErrorCtor: ErrorCtor { + Q_MANAGED URIErrorCtor(ExecutionContext *scope); static ReturnedValue construct(Managed *m, CallData *callData); - -protected: - static const ManagedVTable static_vtbl; }; |