Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -564,7 +564,6 @@ void ScriptEngine::resetModuleCache(bool deleteScriptCache) { · 563 unmodified lines | ||
| 564 | 564 | if (it.flags() & QScriptValue::SkipInEnumeration) { |
| 565 | 565 | continue; |
| 566 | 566 | } |
| 567 | − //scriptCache->deleteScript(it.name()); | |
| 568 | 567 | qCDebug(scriptengine) << "resetModuleCache(true) -- staging " << it.name() << " for cache reset at next require"; |
| 569 | 568 | cacheMeta.setProperty(it.name(), true); |
| 570 | 569 | } |
| @@ -594,8 +593,8 @@ void ScriptEngine::init() { · 23 unmodified lines | ||
| 594 | 593 | entityScriptingInterface->init(); |
| 595 | 594 | connect(entityScriptingInterface.data(), &EntityScriptingInterface::deletingEntity, this, [this](const EntityItemID& entityID) { |
| 596 | 595 | if (_entityScripts.contains(entityID)) { |
| 597 | − if (isEntityScriptRunning(entityID)) { | |
| 598 | − qCWarning(scriptengine) << "deletingEntity while entity script is still running!" << entityID; | |
| 596 | + if (isEntityScriptRunning(entityID) && !isStopping()) { | |
| 597 | + qCWarning(scriptengine) << "deletingEntity while entity script is still running" << entityID; | |
| 599 | 598 | } |
| 600 | 599 | _entityScripts.remove(entityID); |
| 601 | 600 | emit entityScriptDetailsUpdated(); |
| @@ -954,7 +953,7 @@ QScriptValue ScriptEngine::evaluate(const QString& sourceCode, const QString& fi · 352 unmodified lines | ||
| 954 | 953 | syntaxError.setProperty("detail", "evaluate"); |
| 955 | 954 | } |
| 956 | 955 | raiseException(syntaxError); |
| 957 | − maybeEmitUncaughtException(__FUNCTION__); | |
| 956 | + maybeEmitUncaughtException("lint"); | |
| 958 | 957 | return syntaxError; |
| 959 | 958 | } |
| 960 | 959 | QScriptProgram program { sourceCode, fileName, lineNumber }; |
| @@ -962,14 +961,14 @@ QScriptValue ScriptEngine::evaluate(const QString& sourceCode, const QString& fi · 1 unmodified line | ||
| 962 | 961 | // can this happen? |
| 963 | 962 | auto err = makeError("could not create QScriptProgram for " + fileName); |
| 964 | 963 | raiseException(err); |
| 965 | − maybeEmitUncaughtException(__FUNCTION__); | |
| 964 | + maybeEmitUncaughtException("compile"); | |
| 966 | 965 | return err; |
| 967 | 966 | } |
| 968 | 967 | |
| 969 | 968 | QScriptValue result; |
| 970 | 969 | { |
| 971 | 970 | result = BaseScriptEngine::evaluate(program); |
| 972 | − maybeEmitUncaughtException(__FUNCTION__); | |
| 971 | + maybeEmitUncaughtException("evaluate"); | |
| 973 | 972 | } |
| 974 | 973 | return result; |
| 975 | 974 | } |
| @@ -1644,11 +1643,11 @@ QScriptValue ScriptEngine::require(const QString& moduleId) { · 668 unmodified lines | ||
| 1644 | 1643 | |
| 1645 | 1644 | auto exports = module.property("exports"); |
| 1646 | 1645 | if (!invalidateCache && exports.isObject()) { |
| 1647 | − // we have found a cacheed module -- just need to possibly register it with current parent | |
| 1646 | + // we have found a cached module -- just need to possibly register it with current parent | |
| 1648 | 1647 | qCDebug(scriptengine_module) << QString("require - using cached module '%1' for '%2' (loaded: %3)") |
| 1649 | 1648 | .arg(modulePath).arg(moduleId).arg(module.property("loaded").toString()); |
| 1650 | 1649 | registerModuleWithParent(module, parent); |
| 1651 | − maybeEmitUncaughtException(__FUNCTION__); | |
| 1650 | + maybeEmitUncaughtException("cached module"); | |
| 1652 | 1651 | return exports; |
| 1653 | 1652 | } |
| 1654 | 1653 | |
| @@ -2380,9 +2379,12 @@ void ScriptEngine::unloadEntityScript(const EntityItemID& entityID) { · 725 unmodified lines | ||
| 2380 | 2379 | const EntityScriptDetails &oldDetails = _entityScripts[entityID]; |
| 2381 | 2380 | if (isEntityScriptRunning(entityID)) { |
| 2382 | 2381 | callEntityScriptMethod(entityID, "unload"); |
| 2383 | − } else { | |
| 2382 | + } | |
| 2383 | +#ifdef DEBUG_ENTITY_STATES | |
| 2384 | + else { | |
| 2384 | 2385 | qCDebug(scriptengine) << "unload called while !running" << entityID << oldDetails.status; |
| 2385 | 2386 | } |
| 2387 | +#endif | |
| 2386 | 2388 | if (oldDetails.status != EntityScriptStatus::UNLOADED) { |
| 2387 | 2389 | EntityScriptDetails newDetails; |
| 2388 | 2390 | newDetails.status = EntityScriptStatus::UNLOADED; |