diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-05-23 23:04:49 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-24 08:09:33 +0000 |
commit | de95f4da8bf1e16127aae5e34b3b9f34b1f7bbba (patch) | |
tree | b5c213488b5dba7b683c09a88d875cce9e734617 /src/qml/jsruntime/qv4typedarray_p.h | |
parent | 4613068e9fc4a03048de8bf481c34e7f0aeb0299 (diff) |
Fix the inheritance structure for typed arrays
Change-Id: I8a16c1f5e0252b4ea85ff8f623beb39df747e383
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4typedarray_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4typedarray_p.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4typedarray_p.h b/src/qml/jsruntime/qv4typedarray_p.h index 74561f9c35..5f1d343b36 100644 --- a/src/qml/jsruntime/qv4typedarray_p.h +++ b/src/qml/jsruntime/qv4typedarray_p.h @@ -97,12 +97,18 @@ DECLARE_HEAP_OBJECT(TypedArray, Object) { void init(Type t); }; +struct IntrinsicTypedArrayCtor : FunctionObject { +}; + struct TypedArrayCtor : FunctionObject { void init(QV4::ExecutionContext *scope, TypedArray::Type t); TypedArray::Type type; }; +struct IntrinsicTypedArrayPrototype : Object { +}; + struct TypedArrayPrototype : Object { inline void init(TypedArray::Type t); TypedArray::Type type; @@ -137,6 +143,14 @@ struct Q_QML_PRIVATE_EXPORT TypedArray : Object static bool putIndexed(Managed *m, uint index, const Value &value); }; +struct IntrinsicTypedArrayCtor: FunctionObject +{ + V4_OBJECT2(IntrinsicTypedArrayCtor, FunctionObject) + + static ReturnedValue callAsConstructor(const FunctionObject *f, const Value *argv, int argc); + static ReturnedValue call(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); +}; + struct TypedArrayCtor: FunctionObject { V4_OBJECT2(TypedArrayCtor, FunctionObject) @@ -145,13 +159,12 @@ struct TypedArrayCtor: FunctionObject static ReturnedValue call(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); }; - -struct TypedArrayPrototype : Object +struct IntrinsicTypedArrayPrototype : Object { - V4_OBJECT2(TypedArrayPrototype, Object) + V4_OBJECT2(IntrinsicTypedArrayPrototype, Object) V4_PROTOTYPE(objectPrototype) - void init(ExecutionEngine *engine, TypedArrayCtor *ctor); + void init(ExecutionEngine *engine, IntrinsicTypedArrayCtor *ctor); static ReturnedValue method_get_buffer(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); static ReturnedValue method_get_byteLength(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); @@ -165,6 +178,14 @@ struct TypedArrayPrototype : Object static ReturnedValue method_subarray(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); }; +struct TypedArrayPrototype : Object +{ + V4_OBJECT2(TypedArrayPrototype, Object) + V4_PROTOTYPE(objectPrototype) + + void init(ExecutionEngine *engine, TypedArrayCtor *ctor); +}; + inline void Heap::TypedArrayPrototype::init(TypedArray::Type t) { |