History

Apply suggestions from code review

kasenvr committed 6 years ago

Commit 8a007a41 parent d25adf92 files · +2 −2Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 2 files). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+1−1
@@ -1876,7 +1876,7 @@ QScriptValue ScriptEngine::require(const QString& moduleId, bool forceRedownload · 1875 unmodified lines
1876 // `delete Script.require.cache[Script.require.resolve(moduleId)];`1876 // `delete Script.require.cache[Script.require.resolve(moduleId)];`
1877 1877
1878 // cacheMeta is just used right now to tell deleted keys apart from undefined ones1878 // cacheMeta is just used right now to tell deleted keys apart from undefined ones
1879 bool invalidateCache = (module.isUndefined() && cacheMeta.property(moduleId).isValid()) || forceRedownload;1879 bool invalidateCache = forceRedownload || (module.isUndefined() && cacheMeta.property(moduleId).isValid());
1880 1880
1881 // reset the cacheMeta record so invalidation won't apply next time, even if the module fails to load1881 // reset the cacheMeta record so invalidation won't apply next time, even if the module fails to load
1882 cacheMeta.setProperty(modulePath, QScriptValue());1882 cacheMeta.setProperty(modulePath, QScriptValue());