aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-06-19 18:28:36 +0200
committerLiang Qi <liang.qi@qt.io>2018-06-19 17:23:10 +0000
commitba64b7d013fb95fb7b3afe9f1724edae7fcca2ed (patch)
tree9aaddf6c214b41999a584129e63282b443734ca9 /src/qml
parent9333ea8649838d7e0400b0e94c8cbd4fa5d216b0 (diff)
parent5100d558742c682d83e0d4033d78ed4c9f521f56 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts: .qmake.conf src/plugins/qmltooling/packetprotocol/qpacketprotocol.cpp src/qml/compiler/qv4codegen.cpp tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp Change-Id: I010505326d76ee728ffe5fbd4c7879f28adadb12
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/compiler/qv4codegen.cpp2
-rw-r--r--src/qml/jsruntime/qv4function.cpp9
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp2
-rw-r--r--src/qml/qml/qqmltypeloader.cpp10
4 files changed, 9 insertions, 14 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index 9d15e2ef6b..ec2c0dad3e 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -2360,6 +2360,8 @@ int Codegen::defineFunction(const QString &name, AST::Node *ast,
_module->blocks.append(_context);
_context->blockIndex = _module->blocks.count() - 1;
}
+ if (_module->debugMode) // allow the debugger to see overwritten arguments
+ _context->argumentsCanEscape = true;
// When a user writes the following QML signal binding:
// onSignal: function() { doSomethingUsefull }
diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp
index 10e7fb1b3f..131d3406d2 100644
--- a/src/qml/jsruntime/qv4function.cpp
+++ b/src/qml/jsruntime/qv4function.cpp
@@ -111,6 +111,11 @@ void Function::updateInternalClass(ExecutionEngine *engine, const QList<QByteArr
internalClass = engine->internalClasses(EngineBase::Class_CallContext);
+ // first locals
+ const quint32_le *localsIndices = compiledFunction->localsTable();
+ for (quint32 i = 0; i < compiledFunction->nLocals; ++i)
+ internalClass = internalClass->addMember(engine->identifierTable->identifier(compilationUnit->runtimeStrings[localsIndices[i]]), Attr_NotConfigurable);
+
Scope scope(engine);
ScopedString arg(scope);
for (const QString &parameterName : parameterNames) {
@@ -118,10 +123,6 @@ void Function::updateInternalClass(ExecutionEngine *engine, const QList<QByteArr
internalClass = internalClass->addMember(arg->identifier(), Attr_NotConfigurable);
}
nFormals = parameters.size();
-
- const quint32_le *localsIndices = compiledFunction->localsTable();
- for (quint32 i = 0; i < compiledFunction->nLocals; ++i)
- internalClass = internalClass->addMember(engine->identifierTable->identifier(compilationUnit->runtimeStrings[localsIndices[i]]), Attr_NotConfigurable);
}
QT_END_NAMESPACE
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 5eec51c1e4..73c579f3eb 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -1586,7 +1586,7 @@ ReturnedValue Runtime::method_mod(const Value &left, const Value &right)
{
TRACE2(left, right);
- if (Value::integerCompatible(left, right) && right.integerValue() != 0) {
+ if (Value::integerCompatible(left, right) && left.integerValue() > 0 && right.integerValue() > 0) {
int intRes = left.integerValue() % right.integerValue();
if (intRes != 0 || left.integerValue() >= 0)
return Encode(intRes);
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index d455885699..e886198e80 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -1832,15 +1832,7 @@ QString QQmlTypeLoader::absoluteFilePath(const QString &path)
if (*value)
absoluteFilePath = path;
} else {
- bool exists = false;
-#ifdef Q_OS_UNIX
- struct stat statBuf;
- // XXX Avoid encoding entire path. Should store encoded dirpath in cache
- if (::stat(QFile::encodeName(path).constData(), &statBuf) == 0)
- exists = S_ISREG(statBuf.st_mode);
-#else
- exists = QFile::exists(path);
-#endif
+ bool exists = QFile::exists(path);
fileSet->insert(fileName, new bool(exists));
if (exists)
absoluteFilePath = path;