aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4jscall.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4jscall.cpp')
-rw-r--r--src/qml/jsruntime/qv4jscall.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4jscall.cpp b/src/qml/jsruntime/qv4jscall.cpp
index 350e0fe542..513ae59145 100644
--- a/src/qml/jsruntime/qv4jscall.cpp
+++ b/src/qml/jsruntime/qv4jscall.cpp
@@ -3,6 +3,8 @@
#include "qv4jscall_p.h"
+#include <QtQml/qqmlinfo.h>
+
#include <private/qqmlengine_p.h>
#include <private/qv4qobjectwrapper_p.h>
@@ -20,4 +22,25 @@ void QV4::populateJSCallArguments(ExecutionEngine *v4, JSCallArguments &jsCall,
jsCall.args[ii] = v4->metaTypeToJS(types[ii], args[ii + 1]);
}
+void QV4::warnAboutCoercionToVoid(
+ ExecutionEngine *engine, const Value &value, CoercionProblem problem)
+{
+ auto log = qCritical().nospace().noquote();
+ if (const CppStackFrame *frame = engine->currentStackFrame)
+ log << frame->source() << ':' << frame->lineNumber() << ": ";
+ log << value.toQStringNoThrow()
+ << " should be coerced to void because";
+ switch (problem) {
+ case InsufficientAnnotation:
+ log << " the function called is insufficiently annotated.";
+ break;
+ case InvalidListType:
+ log << " the target type, a list of unknown elements, cannot be resolved.";
+ break;
+ }
+
+ log << " The original value is retained. This will change in a future version of Qt.";
+}
+
+
QT_END_NAMESPACE