Apply suggestions from code review

Co-authored-by: HifiExperiments <53453710+HifiExperiments@users.noreply.github.com>
Co-authored-by: David Rowe <david@ctrlaltstudio.com>
This commit is contained in:
kasenvr 2020-09-07 01:38:44 -04:00 committed by GitHub
parent d25adf9b6f
commit 8a007a4edf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions
libraries/script-engine/src

View file

@ -1876,7 +1876,7 @@ QScriptValue ScriptEngine::require(const QString& moduleId, bool forceRedownload
// `delete Script.require.cache[Script.require.resolve(moduleId)];`
// cacheMeta is just used right now to tell deleted keys apart from undefined ones
bool invalidateCache = (module.isUndefined() && cacheMeta.property(moduleId).isValid()) || forceRedownload;
bool invalidateCache = forceRedownload || (module.isUndefined() && cacheMeta.property(moduleId).isValid());
// reset the cacheMeta record so invalidation won't apply next time, even if the module fails to load
cacheMeta.setProperty(modulePath, QScriptValue());

View file

@ -422,7 +422,7 @@ public:
* @function Script.require
* @param {string} module - The module to use. May be a JavaScript file, a JSON file, or the name of a system module such
* as <code>"appUi"</code> (i.e., the "appUi.js" system module JavaScript file).
* @param {bool} [forceRedownload=false] - Invalidate the cache for this module and redownload it if necessary.
* @param {boolean} [forceRedownload=false] - Invalidate the cache for this module and redownload it if necessary.
* @returns {object|array} The value assigned to <code>module.exports</code> in the JavaScript file, or the value defined
* in the JSON file.
*/