mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode a4177f50c475fc0fa278a78235e3bee9ffdec781 (#8649)
* Merge from vscode a4177f50c475fc0fa278a78235e3bee9ffdec781 * distro * fix tests
This commit is contained in:
@@ -728,7 +728,7 @@ var AMDLoader;
|
||||
var result = compileWrapper.apply(this.exports, args);
|
||||
// cached data aftermath
|
||||
that._handleCachedData(script, scriptSource, cachedDataPath, !options.cachedData, moduleManager);
|
||||
that._verifyCachedData(script, scriptSource, cachedDataPath, hashData);
|
||||
that._verifyCachedData(script, scriptSource, cachedDataPath, hashData, moduleManager);
|
||||
return result;
|
||||
};
|
||||
};
|
||||
@@ -775,7 +775,7 @@ var AMDLoader;
|
||||
var scriptOpts = { filename: vmScriptPathOrUri_1, cachedData: cachedData };
|
||||
var script = _this._createAndEvalScript(moduleManager, scriptSource, scriptOpts, callback, errorback);
|
||||
_this._handleCachedData(script, scriptSource, cachedDataPath_1, wantsCachedData_1 && !cachedData, moduleManager);
|
||||
_this._verifyCachedData(script, scriptSource, cachedDataPath_1, hashData);
|
||||
_this._verifyCachedData(script, scriptSource, cachedDataPath_1, hashData, moduleManager);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -906,7 +906,7 @@ var AMDLoader;
|
||||
});
|
||||
}
|
||||
};
|
||||
NodeScriptLoader.prototype._verifyCachedData = function (script, scriptSource, cachedDataPath, hashData) {
|
||||
NodeScriptLoader.prototype._verifyCachedData = function (script, scriptSource, cachedDataPath, hashData, moduleManager) {
|
||||
var _this = this;
|
||||
if (!hashData) {
|
||||
// nothing to do
|
||||
@@ -922,8 +922,8 @@ var AMDLoader;
|
||||
// for violations of this contract.
|
||||
var hashDataNow = _this._crypto.createHash('md5').update(scriptSource, 'utf8').digest();
|
||||
if (!hashData.equals(hashDataNow)) {
|
||||
console.warn("FAILED TO VERIFY CACHED DATA. Deleting '" + cachedDataPath + "' now, but a RESTART IS REQUIRED");
|
||||
_this._fs.unlink(cachedDataPath, function (err) { return console.error("FAILED to unlink: '" + cachedDataPath + "'", err); });
|
||||
moduleManager.getConfig().onError(new Error("FAILED TO VERIFY CACHED DATA, deleting stale '" + cachedDataPath + "' now, but a RESTART IS REQUIRED"));
|
||||
_this._fs.unlink(cachedDataPath, function (err) { return moduleManager.getConfig().onError(err); });
|
||||
}
|
||||
}, Math.ceil(5000 * (1 + Math.random())));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user