Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qv4jscall.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant
4
5#include "qv4jscall_p.h"
6
7#include <QtQml/qqmlinfo.h>
8
9#include <private/qqmlengine_p.h>
10#include <private/qv4qobjectwrapper_p.h>
11
13
14/*! \internal
15
16 Sets the arguments of JSCallData from type erased \a args based on type
17 information provided by \a types
18 */
19void QV4::populateJSCallArguments(ExecutionEngine *v4, JSCallArguments &jsCall,
20 int argc, void **args, const QMetaType *types)
21{
22 for (int ii = 0; ii < argc; ++ii)
23 jsCall.args[ii] = v4->metaTypeToJS(types[ii], args[ii + 1]);
24}
25
26void QV4::warnAboutCoercionToVoid(
27 ExecutionEngine *engine, const Value &value, CoercionProblem problem)
28{
29 auto log = qCritical().nospace().noquote();
30 if (const CppStackFrame *frame = engine->currentStackFrame)
31 log << frame->source() << ':' << frame->lineNumber() << ": ";
32 log << value.toQStringNoThrow()
33 << " should be coerced to void because";
34 switch (problem) {
36 log << " the function called is insufficiently annotated.";
37 break;
38 case InvalidListType:
39 log << " the target type, a list of unknown elements, cannot be resolved.";
40 break;
41 }
42
43 log << " The original value is retained. This will change in a future version of Qt.";
44}
45
46
47QT_END_NAMESPACE
Definition qjsvalue.h:23
CoercionProblem
@ InvalidListType
@ InsufficientAnnotation