revert f9747d8a (rawURL) + apply alternative approach for aligning batch-loaded script URLs

This commit is contained in:
humbletim 2016-11-02 14:58:50 -04:00
parent f9747d8a44
commit d749f243c6
2 changed files with 6 additions and 3 deletions

View file

@ -44,6 +44,7 @@ void BatchLoader::start() {
return;
}
for (const auto& rawURL : _urls) {
QUrl url = expandScriptUrl(normalizeScriptURL(rawURL));
@ -56,12 +57,12 @@ void BatchLoader::start() {
// anything.
ScriptCacheSignalProxy* proxy = new ScriptCacheSignalProxy(scriptCache.data());
connect(proxy, &ScriptCacheSignalProxy::contentAvailable, this, [this, rawURL](const QString& url, const QString& contents, bool isURL, bool success) {
connect(proxy, &ScriptCacheSignalProxy::contentAvailable, this, [this](const QString& url, const QString& contents, bool isURL, bool success) {
if (isURL && success) {
_data.insert(rawURL, contents);
_data.insert(url, contents);
qCDebug(scriptengine) << "Loaded: " << url;
} else {
_data.insert(rawURL, QString());
_data.insert(url, QString());
qCDebug(scriptengine) << "Could not load: " << url;
}

View file

@ -1187,6 +1187,8 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac
thisURL = resolvePath(file);
}
thisURL = expandScriptUrl(normalizeScriptURL(ResourceManager::normalizeURL(thisURL)));
if (!_includedURLs.contains(thisURL)) {
if (!isStandardLibrary && !currentSandboxURL.isEmpty() && (thisURL.scheme() == "file") &&
(currentSandboxURL.scheme() != "file" ||