History

Revert forceRedownload functionality.

Kalila L committed 6 years ago

Commit 8eb12a81 parent 8a007a42 files · +3 −6Browse 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+2−3
@@ -4,7 +4,6 @@ · 3 unmodified lines
4//4//
5// Created by Brad Hefta-Gaub on 12/14/13.5// Created by Brad Hefta-Gaub on 12/14/13.
6// Copyright 2013 High Fidelity, Inc.6// Copyright 2013 High Fidelity, Inc.
7// Copyright 2020 Vircadia contributors.
8//7//
9// Distributed under the Apache License, Version 2.0.8// Distributed under the Apache License, Version 2.0.
10// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html9// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@@ -1837,7 +1836,7 @@ QScriptValue ScriptEngine::instantiateModule(const QScriptValue& module, const Q · 1826 unmodified lines
1837}1836}
1838 1837
1839// CommonJS/Node.js like require/module support1838// CommonJS/Node.js like require/module support
1840QScriptValue ScriptEngine::require(const QString& moduleId, bool forceRedownload) {1839QScriptValue ScriptEngine::require(const QString& moduleId) {
1841 qCDebug(scriptengine_module) << "ScriptEngine::require(" << moduleId.left(MAX_DEBUG_VALUE_LENGTH) << ")";1840 qCDebug(scriptengine_module) << "ScriptEngine::require(" << moduleId.left(MAX_DEBUG_VALUE_LENGTH) << ")";
1842 if (!IS_THREADSAFE_INVOCATION(thread(), __FUNCTION__)) {1841 if (!IS_THREADSAFE_INVOCATION(thread(), __FUNCTION__)) {
1843 return unboundNullValue();1842 return unboundNullValue();
@@ -1876,7 +1875,7 @@ QScriptValue ScriptEngine::require(const QString& moduleId, bool forceRedownload · 32 unmodified lines
1876 // `delete Script.require.cache[Script.require.resolve(moduleId)];`1875 // `delete Script.require.cache[Script.require.resolve(moduleId)];`
1877 1876
1878 // cacheMeta is just used right now to tell deleted keys apart from undefined ones1877 // cacheMeta is just used right now to tell deleted keys apart from undefined ones
1879 bool invalidateCache = forceRedownload || (module.isUndefined() && cacheMeta.property(moduleId).isValid());1878 bool invalidateCache = module.isUndefined() && cacheMeta.property(moduleId).isValid();
1880 1879
1881 // reset the cacheMeta record so invalidation won't apply next time, even if the module fails to load1880 // reset the cacheMeta record so invalidation won't apply next time, even if the module fails to load
1882 cacheMeta.setProperty(modulePath, QScriptValue());1881 cacheMeta.setProperty(modulePath, QScriptValue());