diff options
-rw-r--r-- | tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp | 2 | ||||
-rw-r--r-- | tools/qmlcachegen/qmlcachegen.cpp | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp index 6dc54a323e..48eb694167 100644 --- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp +++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp @@ -253,7 +253,7 @@ void tst_qmlcachegen::errorOnArgumentsInSignalHandler() QByteArray errorOutput; QVERIFY(!generateCache(testFilePath, &errorOutput)); - QVERIFY2(errorOutput.contains("error: The use of the arguments object in signal handlers is"), errorOutput); + QVERIFY2(errorOutput.contains("error: The use of eval() or the use of the arguments object in signal handlers is"), errorOutput); } void tst_qmlcachegen::aheadOfTimeCompilation() diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp index adc9def590..8a2776e808 100644 --- a/tools/qmlcachegen/qmlcachegen.cpp +++ b/tools/qmlcachegen/qmlcachegen.cpp @@ -147,11 +147,13 @@ static bool checkArgumentsObjectUseInSignalHandlers(const QmlIR::Document &doc, if (compiledFunction->column > 0) error->message += QString::number(compiledFunction->column) + QLatin1Char(':'); - error->message += QLatin1String(" error: The use of the arguments object in signal handlers is\n" - "not supported when compiling qml files ahead of time, because it may be ambiguous if\n" - "any signal parameter is called \"arguments\". Unfortunately we cannot distinguish\n" - "between it being a parameter or the JavaScript arguments object at this point.\n" - "Consider renaming the parameter of the signal if applicable."); + error->message += QLatin1String(" error: The use of eval() or the use of the arguments object in signal handlers is\n" + "not supported when compiling qml files ahead of time. That is because it's ambiguous if \n" + "any signal parameter is called \"arguments\". Similarly the string passed to eval might use\n" + "\"arguments\". Unfortunately we cannot distinguish between it being a parameter or the\n" + "JavaScript arguments object at this point.\n" + "Consider renaming the parameter of the signal if applicable or moving the code into a\n" + "helper function."); return false; } } |