diff options
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 4 | ||||
-rw-r--r-- | src/qml/compiler/qv4codegen_p.h | 1 | ||||
-rw-r--r-- | tools/qmlcachegen/qmlcachegen.cpp | 13 |
3 files changed, 5 insertions, 13 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 0ca452b93e..66c334d197 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -103,7 +103,7 @@ Codegen::Codegen(QV4::Compiler::JSUnitGenerator *jsUnitGenerator, bool strict) pushExpr(); } -const char *globalNames[] = { +const char *Codegen::s_globalNames[] = { "isNaN", "parseFloat", "String", @@ -183,7 +183,7 @@ void Codegen::generateFromProgram(const QString &fileName, // // Since this can be called from the loader thread we can't get the list // directly from the engine, so let's hardcode the most important ones here - for (const char **g = globalNames; *g != nullptr; ++g) + for (const char **g = s_globalNames; *g != nullptr; ++g) m_globalNames << QString::fromLatin1(*g); } diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h index a6355bf93a..0b25d9c53d 100644 --- a/src/qml/compiler/qv4codegen_p.h +++ b/src/qml/compiler/qv4codegen_p.h @@ -754,6 +754,7 @@ public: m_globalNames = globalNames; } + static const char *s_globalNames[]; protected: friend class ScanFunctions; diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp index 1805dde5d2..1bfc831dac 100644 --- a/tools/qmlcachegen/qmlcachegen.cpp +++ b/tools/qmlcachegen/qmlcachegen.cpp @@ -51,17 +51,8 @@ QSet<QString> illegalNames; void setupIllegalNames() { - // #### this in incomplete - illegalNames.insert(QStringLiteral("Math")); - illegalNames.insert(QStringLiteral("Array")); - illegalNames.insert(QStringLiteral("String")); - illegalNames.insert(QStringLiteral("Function")); - illegalNames.insert(QStringLiteral("Boolean")); - illegalNames.insert(QStringLiteral("Number")); - illegalNames.insert(QStringLiteral("Date")); - illegalNames.insert(QStringLiteral("RegExp")); - illegalNames.insert(QStringLiteral("Error")); - illegalNames.insert(QStringLiteral("Object")); + for (const char **g = QV4::Compiler::Codegen::s_globalNames; *g != nullptr; ++g) + illegalNames.insert(QString::fromLatin1(*g)); } struct Error |