forked from qt-creator/qt-creator
QmlDesigner: Do not allow print as id
Task-number: QDS-4162 Change-Id: I7cce6fbeabff35e1d4469c93c73b02b56ff6d4a5 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -151,36 +151,14 @@ QString ModelNode::validId()
|
||||
|
||||
static bool idIsQmlKeyWord(const QString& id)
|
||||
{
|
||||
static const QSet<QString> keywords = {
|
||||
"as",
|
||||
"break",
|
||||
"case",
|
||||
"catch",
|
||||
"continue",
|
||||
"debugger",
|
||||
"default",
|
||||
"delete",
|
||||
"do",
|
||||
"else",
|
||||
"finally",
|
||||
"for",
|
||||
"function",
|
||||
"if",
|
||||
"import",
|
||||
"in",
|
||||
"instanceof",
|
||||
"new",
|
||||
"return",
|
||||
"switch",
|
||||
"this",
|
||||
"throw",
|
||||
"try",
|
||||
"typeof",
|
||||
"var",
|
||||
"void",
|
||||
"while",
|
||||
"with"
|
||||
};
|
||||
static const QSet<QString> keywords = {"as", "break", "case", "catch",
|
||||
"continue", "debugger", "default", "delete",
|
||||
"do", "else", "finally", "for",
|
||||
"function", "if", "import", "in",
|
||||
"instanceof", "new", "print", "return",
|
||||
"switch", "this", "throw", "try",
|
||||
"typeof", "var", "void", "while",
|
||||
"with"};
|
||||
|
||||
return keywords.contains(id);
|
||||
}
|
||||
|
Reference in New Issue
Block a user