forked from qt-creator/qt-creator
QmlJS: Add "Symbol, Object, Function, RegExp" to global functions
This fixes a false positive error message. Task-number: QTCREATORBUG-22599 Change-Id: Ibdf9a3a6b1679bd11afa87ca3d5e77fcda773ce0 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -1674,7 +1674,8 @@ bool Check::visit(CallExpression *ast)
|
||||
if (!whiteListedFunction && !isMathFunction && !isDateFunction && !isDirectInConnectionsScope)
|
||||
addMessage(ErrFunctionsNotSupportedInQmlUi, location);
|
||||
|
||||
static const QStringList globalFunctions = {"String", "Boolean", "Date", "Number", "Object", "Array", "QT_TR_NOOP", "QT_TRANSLATE_NOOP", "QT_TRID_NOOP"};
|
||||
static const QStringList globalFunctions = {"String", "Boolean", "Date", "Number", "Object", "Array", "Symbol", "Object", "Function", "RegExp",
|
||||
"QT_TR_NOOP", "QT_TRANSLATE_NOOP", "QT_TRID_NOOP"};
|
||||
|
||||
if (!name.isEmpty() && name.at(0).isUpper() && !globalFunctions.contains(name)) {
|
||||
addMessage(WarnExpectedNewWithUppercaseFunction, location);
|
||||
|
Reference in New Issue
Block a user