diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-08-04 10:39:09 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-08-06 10:00:45 +0000 |
commit | d046de0ddb7a8d8762821915d3973a1bea9d499c (patch) | |
tree | 3e75616f9cb1e4bf9cbb5fdaa337223365e01dd5 /src/qml/jsruntime/qv4errorobject.cpp | |
parent | 15ef80f1d92eb3a88dc135b4e6347f57a5982f9c (diff) |
Setup the prototype correctly when subclassing error objects
Change-Id: I5e394ef8d4d6d87bedb26070d51660e3ebe3ab1b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4errorobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4errorobject.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/qml/jsruntime/qv4errorobject.cpp b/src/qml/jsruntime/qv4errorobject.cpp index 53c070898f..f8812b019d 100644 --- a/src/qml/jsruntime/qv4errorobject.cpp +++ b/src/qml/jsruntime/qv4errorobject.cpp @@ -229,10 +229,10 @@ void Heap::ErrorCtor::init(QV4::ExecutionContext *scope, const QString &name) Heap::FunctionObject::init(scope, name); } -ReturnedValue ErrorCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *) +ReturnedValue ErrorCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *newTarget) { Value v = argc ? *argv : Primitive::undefinedValue(); - return ErrorObject::create<ErrorObject>(f->engine(), v)->asReturnedValue(); + return ErrorObject::create<ErrorObject>(f->engine(), v, newTarget)->asReturnedValue(); } ReturnedValue ErrorCtor::virtualCall(const FunctionObject *f, const Value *, const Value *argv, int argc) @@ -245,10 +245,10 @@ void Heap::EvalErrorCtor::init(QV4::ExecutionContext *scope) Heap::FunctionObject::init(scope, QStringLiteral("EvalError")); } -ReturnedValue EvalErrorCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *) +ReturnedValue EvalErrorCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *newTarget) { Value v = argc ? *argv : Primitive::undefinedValue(); - return ErrorObject::create<EvalErrorObject>(f->engine(), v)->asReturnedValue(); + return ErrorObject::create<EvalErrorObject>(f->engine(), v, newTarget)->asReturnedValue(); } void Heap::RangeErrorCtor::init(QV4::ExecutionContext *scope) @@ -256,10 +256,10 @@ void Heap::RangeErrorCtor::init(QV4::ExecutionContext *scope) Heap::FunctionObject::init(scope, QStringLiteral("RangeError")); } -ReturnedValue RangeErrorCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *) +ReturnedValue RangeErrorCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *newTarget) { Value v = argc ? *argv : Primitive::undefinedValue(); - return ErrorObject::create<RangeErrorObject>(f->engine(), v)->asReturnedValue(); + return ErrorObject::create<RangeErrorObject>(f->engine(), v, newTarget)->asReturnedValue(); } void Heap::ReferenceErrorCtor::init(QV4::ExecutionContext *scope) @@ -267,10 +267,10 @@ void Heap::ReferenceErrorCtor::init(QV4::ExecutionContext *scope) Heap::FunctionObject::init(scope, QStringLiteral("ReferenceError")); } -ReturnedValue ReferenceErrorCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *) +ReturnedValue ReferenceErrorCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *newTarget) { Value v = argc ? *argv : Primitive::undefinedValue(); - return ErrorObject::create<ReferenceErrorObject>(f->engine(), v)->asReturnedValue(); + return ErrorObject::create<ReferenceErrorObject>(f->engine(), v, newTarget)->asReturnedValue(); } void Heap::SyntaxErrorCtor::init(QV4::ExecutionContext *scope) @@ -278,10 +278,10 @@ void Heap::SyntaxErrorCtor::init(QV4::ExecutionContext *scope) Heap::FunctionObject::init(scope, QStringLiteral("SyntaxError")); } -ReturnedValue SyntaxErrorCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *) +ReturnedValue SyntaxErrorCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *newTarget) { Value v = argc ? *argv : Primitive::undefinedValue(); - return ErrorObject::create<SyntaxErrorObject>(f->engine(), v)->asReturnedValue(); + return ErrorObject::create<SyntaxErrorObject>(f->engine(), v, newTarget)->asReturnedValue(); } void Heap::TypeErrorCtor::init(QV4::ExecutionContext *scope) @@ -289,10 +289,10 @@ void Heap::TypeErrorCtor::init(QV4::ExecutionContext *scope) Heap::FunctionObject::init(scope, QStringLiteral("TypeError")); } -ReturnedValue TypeErrorCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *) +ReturnedValue TypeErrorCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *newTarget) { Value v = argc ? *argv : Primitive::undefinedValue(); - return ErrorObject::create<TypeErrorObject>(f->engine(), v)->asReturnedValue(); + return ErrorObject::create<TypeErrorObject>(f->engine(), v, newTarget)->asReturnedValue(); } void Heap::URIErrorCtor::init(QV4::ExecutionContext *scope) @@ -300,10 +300,10 @@ void Heap::URIErrorCtor::init(QV4::ExecutionContext *scope) Heap::FunctionObject::init(scope, QStringLiteral("URIError")); } -ReturnedValue URIErrorCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *) +ReturnedValue URIErrorCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *newTarget) { Value v = argc ? *argv : Primitive::undefinedValue(); - return ErrorObject::create<URIErrorObject>(f->engine(), v)->asReturnedValue(); + return ErrorObject::create<URIErrorObject>(f->engine(), v, newTarget)->asReturnedValue(); } void ErrorPrototype::init(ExecutionEngine *engine, Object *ctor, Object *obj, Heap::ErrorObject::ErrorType t) |