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 bool idIsQmlKeyWord(const QString& id)
|
||||||
{
|
{
|
||||||
static const QSet<QString> keywords = {
|
static const QSet<QString> keywords = {"as", "break", "case", "catch",
|
||||||
"as",
|
"continue", "debugger", "default", "delete",
|
||||||
"break",
|
"do", "else", "finally", "for",
|
||||||
"case",
|
"function", "if", "import", "in",
|
||||||
"catch",
|
"instanceof", "new", "print", "return",
|
||||||
"continue",
|
"switch", "this", "throw", "try",
|
||||||
"debugger",
|
"typeof", "var", "void", "while",
|
||||||
"default",
|
"with"};
|
||||||
"delete",
|
|
||||||
"do",
|
|
||||||
"else",
|
|
||||||
"finally",
|
|
||||||
"for",
|
|
||||||
"function",
|
|
||||||
"if",
|
|
||||||
"import",
|
|
||||||
"in",
|
|
||||||
"instanceof",
|
|
||||||
"new",
|
|
||||||
"return",
|
|
||||||
"switch",
|
|
||||||
"this",
|
|
||||||
"throw",
|
|
||||||
"try",
|
|
||||||
"typeof",
|
|
||||||
"var",
|
|
||||||
"void",
|
|
||||||
"while",
|
|
||||||
"with"
|
|
||||||
};
|
|
||||||
|
|
||||||
return keywords.contains(id);
|
return keywords.contains(id);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user