diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-22 09:20:43 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-06-26 10:04:11 +0000 |
commit | e9b3bdb96e008060a0e78815a3995015e5e4598d (patch) | |
tree | b3213bc461329723e9fd119a65a5556c12209a21 /src/qml/jsruntime/qv4functionobject_p.h | |
parent | 046d1c5db44f409c67244bd70b13077cc03219b2 (diff) |
Various fixes for class support
Add support for a default constructor if none is given.
Fix support for computed method names, by unifying the
handling between static and non static methods. Fix our
table generation, so that we write UINT_MAX as the string
index for undefined strings and not a reference to the
empty string, as that can actually be a valid method
name.
Add support for getter and setter methods in classes.
Change-Id: If52c57d6a67424b0218b86339b95aed9d0351e47
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject_p.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index 1e7df2c27e..7a7c86a6c3 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -124,6 +124,10 @@ struct ConstructorFunction : ScriptFunction { }; +struct DefaultClassConstructorFunction : FunctionObject +{ +}; + #define BoundFunctionMembers(class, Member) \ Member(class, Pointer, FunctionObject *, target) \ Member(class, HeapValue, HeapValue, boundThis) \ @@ -243,6 +247,12 @@ struct ConstructorFunction : ScriptFunction { static ReturnedValue call(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); }; +struct DefaultClassConstructorFunction : FunctionObject { + V4_OBJECT2(DefaultClassConstructorFunction, FunctionObject) + static ReturnedValue callAsConstructor(const FunctionObject *, const Value *argv, int argc); + static ReturnedValue call(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); +}; + struct BoundFunction: FunctionObject { V4_OBJECT2(BoundFunction, FunctionObject) |