diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-08-01 21:39:35 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-08-02 20:25:18 +0000 |
commit | 245cb6b6a3e5a04dc43a3c4ce15831f68309e97f (patch) | |
tree | da8e49f1110967f28a8f37dcd3e5a373297b0297 /src/qml/jsruntime/qv4errorobject_p.h | |
parent | f289141524d9331bdafd9f88d95e0fa9b29ccdee (diff) |
Fix a couple of test failures related to error objects
Set up the prototype chain for error objects correctly, and make
them inherit from the right classes.
Change-Id: I7bb12b3bb285950a1bff25e5c62954287a95970a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4errorobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4errorobject_p.h | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/qml/jsruntime/qv4errorobject_p.h b/src/qml/jsruntime/qv4errorobject_p.h index 90ef4dd842..fd042ca8f0 100644 --- a/src/qml/jsruntime/qv4errorobject_p.h +++ b/src/qml/jsruntime/qv4errorobject_p.h @@ -115,7 +115,7 @@ struct URIErrorObject : ErrorObject { void init(const Value &message); }; -struct ErrorCtor : Heap::FunctionObject { +struct ErrorCtor : FunctionObject { void init(QV4::ExecutionContext *scope); void init(QV4::ExecutionContext *scope, const QString &name); }; @@ -235,48 +235,54 @@ struct ErrorCtor: FunctionObject struct EvalErrorCtor: ErrorCtor { - V4_OBJECT2(EvalErrorCtor, ErrorCtor) + V4_OBJECT2(EvalErrorCtor, FunctionObject) + V4_PROTOTYPE(errorCtor) static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); }; struct RangeErrorCtor: ErrorCtor { - V4_OBJECT2(RangeErrorCtor, ErrorCtor) + V4_OBJECT2(RangeErrorCtor, FunctionObject) + V4_PROTOTYPE(errorCtor) static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); }; struct ReferenceErrorCtor: ErrorCtor { - V4_OBJECT2(ReferenceErrorCtor, ErrorCtor) + V4_OBJECT2(ReferenceErrorCtor, FunctionObject) + V4_PROTOTYPE(errorCtor) static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); }; struct SyntaxErrorCtor: ErrorCtor { - V4_OBJECT2(SyntaxErrorCtor, ErrorCtor) + V4_OBJECT2(SyntaxErrorCtor, FunctionObject) + V4_PROTOTYPE(errorCtor) static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); }; struct TypeErrorCtor: ErrorCtor { - V4_OBJECT2(TypeErrorCtor, ErrorCtor) + V4_OBJECT2(TypeErrorCtor, FunctionObject) + V4_PROTOTYPE(errorCtor) static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); }; struct URIErrorCtor: ErrorCtor { - V4_OBJECT2(URIErrorCtor, ErrorCtor) + V4_OBJECT2(URIErrorCtor, FunctionObject) + V4_PROTOTYPE(errorCtor) static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *); }; -struct ErrorPrototype : ErrorObject +struct ErrorPrototype : Object { enum { Index_Constructor = 0, @@ -289,32 +295,32 @@ struct ErrorPrototype : ErrorObject static ReturnedValue method_toString(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); }; -struct EvalErrorPrototype : ErrorObject +struct EvalErrorPrototype : Object { void init(ExecutionEngine *engine, Object *ctor) { ErrorPrototype::init(engine, ctor, this, Heap::ErrorObject::EvalError); } }; -struct RangeErrorPrototype : ErrorObject +struct RangeErrorPrototype : Object { void init(ExecutionEngine *engine, Object *ctor) { ErrorPrototype::init(engine, ctor, this, Heap::ErrorObject::RangeError); } }; -struct ReferenceErrorPrototype : ErrorObject +struct ReferenceErrorPrototype : Object { void init(ExecutionEngine *engine, Object *ctor) { ErrorPrototype::init(engine, ctor, this, Heap::ErrorObject::ReferenceError); } }; -struct SyntaxErrorPrototype : ErrorObject +struct SyntaxErrorPrototype : Object { void init(ExecutionEngine *engine, Object *ctor) { ErrorPrototype::init(engine, ctor, this, Heap::ErrorObject::SyntaxError); } }; -struct TypeErrorPrototype : ErrorObject +struct TypeErrorPrototype : Object { void init(ExecutionEngine *engine, Object *ctor) { ErrorPrototype::init(engine, ctor, this, Heap::ErrorObject::TypeError); } }; -struct URIErrorPrototype : ErrorObject +struct URIErrorPrototype : Object { void init(ExecutionEngine *engine, Object *ctor) { ErrorPrototype::init(engine, ctor, this, Heap::ErrorObject::URIError); } }; |