History

Update system to use a checkbox + setting instead.

Kalila L committed 6 years ago

Commit 9f3978d1 parent 8eb12a85 files · +24 −1Browse files

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

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+4−1
@@ -1873,9 +1873,12 @@ QScriptValue ScriptEngine::require(const QString& moduleId) { · 1872 unmodified lines
18731873 // modules get cached in `Script.require.cache` and (similar to Node.js) users can access it
18741874 // to inspect particular entries and invalidate them by deleting the key:
18751875 // `delete Script.require.cache[Script.require.resolve(moduleId)];`
1876+
1877+ // Check to see if
1878+ Setting::Handle<bool> getCachebustSetting {"cachebustScriptRequire", false };
18761879
18771880 // cacheMeta is just used right now to tell deleted keys apart from undefined ones
1878− bool invalidateCache = module.isUndefined() && cacheMeta.property(moduleId).isValid();
1881+ bool invalidateCache = getCachebustSetting.get() || (module.isUndefined() && cacheMeta.property(moduleId).isValid());
18791882
18801883 // reset the cacheMeta record so invalidation won't apply next time, even if the module fails to load
18811884 cacheMeta.setProperty(modulePath, QScriptValue());