Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1089,9 +1089,18 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 1088 unmodified lines | ||
| 1089 | 1089 | } |
| 1090 | 1090 | |
| 1091 | 1091 | if (!testConstructor.isFunction()) { |
| 1092 | − qCDebug(scriptengine) << "ScriptEngine::loadEntityScript() entity:" << entityID << "\n" | |
| 1093 | − " NOT CONSTRUCTOR\n" | |
| 1094 | − " SCRIPT:" << scriptOrURL; | |
| 1092 | + QString testConstructorType = QString(testConstructor.toVariant().typeName()); | |
| 1093 | + if (testConstructorType == "") { | |
| 1094 | + testConstructorType = "empty"; | |
| 1095 | + } | |
| 1096 | + QString testConstructorValue = testConstructor.toString(); | |
| 1097 | + if (testConstructorValue.size() > 80) { | |
| 1098 | + testConstructorValue = testConstructorValue.mid(0, 80) + "..."; | |
| 1099 | + } | |
| 1100 | + qCDebug(scriptengine) << "Error -- ScriptEngine::loadEntityScript() entity:" << entityID | |
| 1101 | + << "failed to load entity script -- expected a function, got " + testConstructorType | |
| 1102 | + << "," << testConstructorValue | |
| 1103 | + << "," << scriptOrURL; | |
| 1095 | 1104 | |
| 1096 | 1105 | if (!isFileUrl) { |
| 1097 | 1106 | scriptCache->addScriptToBadScriptList(scriptOrURL); |