mirror of
https://github.com/Microsoft/vscode
synced 2024-10-06 03:17:00 +00:00
update loader (#149878)
This commit is contained in:
parent
fbbcdc9411
commit
ba2dd82580
|
@ -16,10 +16,6 @@
|
|||
'use strict';
|
||||
var CSSLoaderPlugin;
|
||||
(function (CSSLoaderPlugin) {
|
||||
/**
|
||||
* Known issue:
|
||||
* - In IE there is no way to know if the CSS file loaded successfully or not.
|
||||
*/
|
||||
var BrowserCSSLoader = /** @class */ (function () {
|
||||
function BrowserCSSLoader() {
|
||||
this._pendingLoads = 0;
|
||||
|
|
|
@ -277,8 +277,10 @@ var AMDLoader;
|
|||
return;
|
||||
}
|
||||
if (err.phase === 'factory') {
|
||||
console.error('The factory method of "' + err.moduleId + '" has thrown an exception');
|
||||
console.error('The factory function of "' + err.moduleId + '" has thrown an exception');
|
||||
console.error(err);
|
||||
console.error('Here are the modules that depend on it:');
|
||||
console.error(err.neededBy);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1183,7 +1185,7 @@ var AMDLoader;
|
|||
producedError: null
|
||||
};
|
||||
};
|
||||
Module.prototype.complete = function (recorder, config, dependenciesValues) {
|
||||
Module.prototype.complete = function (recorder, config, dependenciesValues, inversedependenciesProvider) {
|
||||
this._isComplete = true;
|
||||
var producedError = null;
|
||||
if (this._callback) {
|
||||
|
@ -1204,6 +1206,7 @@ var AMDLoader;
|
|||
var err = AMDLoader.ensureError(producedError);
|
||||
err.phase = 'factory';
|
||||
err.moduleId = this.strId;
|
||||
err.neededBy = inversedependenciesProvider(this.id);
|
||||
this.error = err;
|
||||
config.onError(err);
|
||||
}
|
||||
|
@ -1815,7 +1818,10 @@ var AMDLoader;
|
|||
dependenciesValues[i] = null;
|
||||
}
|
||||
}
|
||||
module.complete(recorder, this._config, dependenciesValues);
|
||||
var inversedependenciesProvider = function (moduleId) {
|
||||
return (_this._inverseDependencies2[moduleId] || []).map(function (intModuleId) { return _this._moduleIdProvider.getStrModuleId(intModuleId); });
|
||||
};
|
||||
module.complete(recorder, this._config, dependenciesValues, inversedependenciesProvider);
|
||||
// Fetch and clear inverse dependencies
|
||||
var inverseDeps = this._inverseDependencies2[module.id];
|
||||
this._inverseDependencies2[module.id] = null;
|
||||
|
|
|
@ -114,6 +114,7 @@ var NLSLoaderPlugin;
|
|||
};
|
||||
NLSPlugin.prototype.load = function (name, req, load, config) {
|
||||
var _this = this;
|
||||
var _a;
|
||||
config = config || {};
|
||||
if (!name || name.length === 0) {
|
||||
load({
|
||||
|
@ -148,7 +149,13 @@ var NLSLoaderPlugin;
|
|||
});
|
||||
}
|
||||
else {
|
||||
req([name + suffix], messagesLoaded_1);
|
||||
var base = (_a = pluginConfig.baseUrl) !== null && _a !== void 0 ? _a : '';
|
||||
req([base + name + suffix], messagesLoaded_1, function (err) {
|
||||
var _a;
|
||||
// We have an error. Load the English default strings instead.
|
||||
console.warn("Falling back to default strings. Unable to load translations because of: " + ((_a = err.message) !== null && _a !== void 0 ? _a : err));
|
||||
req([name + '.nls'], messagesLoaded_1);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue