diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-10-21 15:55:45 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-11-07 21:07:41 +0000 |
commit | 6e3317bb171c718250bbb736567fc0e4812a6241 (patch) | |
tree | f4bbea80d807093ee077cb30a516517f2b47aacf /src/qml/jsruntime/qv4dataview.cpp | |
parent | 7f4a2f38b0440cc296949069822ae14d0b392da8 (diff) |
Change signature for call/callAsConstructor
Change-Id: I159b57acc7a2133ef1ad545aa84e792c63449a57
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4dataview.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4dataview.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4dataview.cpp b/src/qml/jsruntime/qv4dataview.cpp index db5b41603e..815f6ed991 100644 --- a/src/qml/jsruntime/qv4dataview.cpp +++ b/src/qml/jsruntime/qv4dataview.cpp @@ -54,17 +54,17 @@ void Heap::DataViewCtor::init(QV4::ExecutionContext *scope) Heap::FunctionObject::init(scope, QStringLiteral("DataView")); } -ReturnedValue DataViewCtor::callAsConstructor(const Managed *m, CallData *callData) +ReturnedValue DataViewCtor::callAsConstructor(const FunctionObject *f, const Value *argv, int argc) { - Scope scope(m->engine()); - Scoped<ArrayBuffer> buffer(scope, callData->argument(0)); + Scope scope(f->engine()); + Scoped<ArrayBuffer> buffer(scope, argc ? argv[0] : Primitive::undefinedValue()); if (!buffer) return scope.engine->throwTypeError(); - double bo = callData->argc() > 1 ? callData->args[1].toNumber() : 0; + double bo = argc > 1 ? argv[1].toNumber() : 0; uint byteOffset = (uint)bo; uint bufferLength = buffer->d()->data->size; - double bl = callData->argc() < 3 || callData->args[2].isUndefined() ? (bufferLength - bo) : callData->args[2].toNumber(); + double bl = argc < 3 || argv[2].isUndefined() ? (bufferLength - bo) : argv[2].toNumber(); uint byteLength = (uint)bl; if (bo != byteOffset || bl != byteLength || byteOffset + byteLength > bufferLength) return scope.engine->throwRangeError(QStringLiteral("DataView: constructor arguments out of range")); @@ -76,9 +76,9 @@ ReturnedValue DataViewCtor::callAsConstructor(const Managed *m, CallData *callDa return a.asReturnedValue(); } -ReturnedValue DataViewCtor::call(const Managed *that, CallData *callData) +ReturnedValue DataViewCtor::call(const FunctionObject *f, const Value *, const Value *argv, int argc) { - return callAsConstructor(that, callData); + return callAsConstructor(f, argv, argc); } void DataViewPrototype::init(ExecutionEngine *engine, Object *ctor) |