diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-07-01 12:00:57 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-07-03 08:09:17 +0000 |
commit | d31541fd9d7d52ef3eae29e7e5d36733d7f55375 (patch) | |
tree | c5d17bea0119c9f0eb26e97eb523b281e9900783 /src/qml/compiler/qv4codegen_p.h | |
parent | 6e79a00cad2f5dd09bdf40e594a65af58b370d9d (diff) |
Add support for super properties
Those are mostly working now, but when calling super properties
the this object is not setup correctly.
Change-Id: Ib42129ae6e729eeca00275f707f480371b7e42a5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen_p.h')
-rw-r--r-- | src/qml/compiler/qv4codegen_p.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h index 814754aea2..337c4dbfe3 100644 --- a/src/qml/compiler/qv4codegen_p.h +++ b/src/qml/compiler/qv4codegen_p.h @@ -180,6 +180,7 @@ public: Invalid, Accumulator, Super, + SuperProperty, StackSlot, ScopedLocal, Name, @@ -217,6 +218,7 @@ public: bool isConstant() const { return type == Const; } bool isAccumulator() const { return type == Accumulator; } bool isSuper() const { return type == Super; } + bool isSuperProperty() const { return type == SuperProperty; } bool isStackSlot() const { return type == StackSlot; } bool isRegister() const { return isStackSlot(); @@ -282,6 +284,12 @@ public: r.propertyNameIndex = r.codegen->registerString(name); return r; } + static Reference fromSuperProperty(const Reference &property) { + Q_ASSERT(property.isStackSlot()); + Reference r(property.codegen, SuperProperty); + r.property = property.stackSlot(); + return r; + } static Reference fromSubscript(const Reference &baseRef, const Reference &subscript) { Q_ASSERT(baseRef.isStackSlot()); Reference r(baseRef.codegen, Subscript); @@ -368,6 +376,7 @@ public: qint16 qmlNotifyIndex; PropertyCapturePolicy capturePolicy; }; + Moth::StackSlot property; // super property }; QString name; mutable bool isArgOrEval = false; |