diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-09-14 14:54:42 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-09-19 09:44:33 +0000 |
commit | 042aa2eb0e55616fc754d0d71246efb531ca6dfe (patch) | |
tree | f48118a1f8564b4c4cbadc0ebf291d56d59dbb70 /src/qml/qml/qqmldelayedcallqueue.cpp | |
parent | b7ddcdad876cf0a46aa14a0f78ee8b3e4f685c19 (diff) |
Change CallData::argc to be a QV4::Value
Instead of mimicking a Value. This makes sure that argc now stays
correct even when anything on Value changes.
Most of the change is mechanical: replace callData->argc by
callData->argc().
Change-Id: I521831ae1ffb3966bad6589c18d7a373e13439d7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml/qqmldelayedcallqueue.cpp')
-rw-r--r-- | src/qml/qml/qqmldelayedcallqueue.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/qml/qml/qqmldelayedcallqueue.cpp b/src/qml/qml/qqmldelayedcallqueue.cpp index 1537657e0d..738f87247f 100644 --- a/src/qml/qml/qqmldelayedcallqueue.cpp +++ b/src/qml/qml/qqmldelayedcallqueue.cpp @@ -109,7 +109,7 @@ void QQmlDelayedCallQueue::init(QV4::ExecutionEngine* engine) QV4::ReturnedValue QQmlDelayedCallQueue::addUniquelyAndExecuteLater(const QV4::BuiltinFunction *b, QV4::CallData *callData) { QV4::Scope scope(b); - if (callData->argc == 0) + if (callData->argc() == 0) THROW_GENERIC_ERROR("Qt.callLater: no arguments given"); const QV4::FunctionObject *func = callData->args[0].as<QV4::FunctionObject>(); @@ -176,17 +176,16 @@ QV4::ReturnedValue QQmlDelayedCallQueue::addUniquelyAndExecuteLater(const QV4::B void QQmlDelayedCallQueue::storeAnyArguments(DelayedFunctionCall &dfc, const QV4::CallData *callData, int offset, QV4::ExecutionEngine *engine) { - const int length = callData->argc - offset; + const int length = callData->argc() - offset; if (length == 0) { dfc.m_args.clear(); return; } QV4::Scope scope(engine); QV4::ScopedArrayObject array(scope, engine->newArrayObject(length)); - int i = 0; - for (int j = offset; j < callData->argc; ++i, ++j) { + uint i = 0; + for (int j = offset, ej = callData->argc(); j < ej; ++i, ++j) array->putIndexed(i, callData->args[j]); - } dfc.m_args.set(engine, array); } |