Merge from vscode fcf3346a8e9f5ee1e00674461d9e2c2292a14ee3 (#12295)

* Merge from vscode fcf3346a8e9f5ee1e00674461d9e2c2292a14ee3

* Fix test build break

* Update distro

* Fix build errors

* Update distro

* Update REH build file

* Update build task names for REL

* Fix product build yaml

* Fix product REH task name

* Fix type in task name

* Update linux build step

* Update windows build tasks

* Turn off server publish

* Disable REH

* Fix typo

* Bump distro

* Update vscode tests

* Bump distro

* Fix type in disto

* Bump distro

* Turn off docker build

* Remove docker step from release

Co-authored-by: ADS Merger <andresse@microsoft.com>
Co-authored-by: Karl Burtram <karlb@microsoft.com>
This commit is contained in:
Christopher Suh
2020-10-03 14:42:05 -04:00
committed by GitHub
parent 58d02b76db
commit 6ff1e3866b
687 changed files with 10507 additions and 9104 deletions

View File

@@ -618,8 +618,37 @@ var AMDLoader;
};
return OnlyOnceScriptLoader;
}());
var trustedTypesPolyfill = new /** @class */(function () {
function class_1() {
}
class_1.prototype.installIfNeeded = function () {
if (typeof globalThis.trustedTypes !== 'undefined') {
return; // already defined
}
var _defaultRules = {
createHTML: function () { throw new Error('Policy\'s TrustedTypePolicyOptions did not specify a \'createHTML\' member'); },
createScript: function () { throw new Error('Policy\'s TrustedTypePolicyOptions did not specify a \'createScript\' member'); },
createScriptURL: function () { throw new Error('Policy\'s TrustedTypePolicyOptions did not specify a \'createScriptURL\' member'); },
};
globalThis.trustedTypes = {
createPolicy: function (name, rules) {
var _a, _b, _c;
return {
name: name,
createHTML: (_a = rules.createHTML) !== null && _a !== void 0 ? _a : _defaultRules.createHTML,
createScript: (_b = rules.createScript) !== null && _b !== void 0 ? _b : _defaultRules.createScript,
createScriptURL: (_c = rules.createScriptURL) !== null && _c !== void 0 ? _c : _defaultRules.createScriptURL,
};
}
};
};
return class_1;
}());
//#endregion
var BrowserScriptLoader = /** @class */ (function () {
function BrowserScriptLoader() {
// polyfill trustedTypes-support if missing
trustedTypesPolyfill.installIfNeeded();
}
/**
* Attach load / error listeners to a script element and remove them when either one has fired.
@@ -662,6 +691,13 @@ var AMDLoader;
script.setAttribute('async', 'async');
script.setAttribute('type', 'text/javascript');
this.attachListeners(script, callback, errorback);
var createTrustedScriptURL = moduleManager.getConfig().getOptionsLiteral().createTrustedScriptURL;
if (createTrustedScriptURL) {
if (!this.scriptSourceURLPolicy) {
this.scriptSourceURLPolicy = trustedTypes.createPolicy('amdLoader', { createScriptURL: createTrustedScriptURL });
}
scriptSrc = this.scriptSourceURLPolicy.createScriptURL(scriptSrc);
}
script.setAttribute('src', scriptSrc);
// Propagate CSP nonce to dynamically created script tag.
var cspNonce = moduleManager.getConfig().getOptionsLiteral().cspNonce;
@@ -675,8 +711,17 @@ var AMDLoader;
}());
var WorkerScriptLoader = /** @class */ (function () {
function WorkerScriptLoader() {
// polyfill trustedTypes-support if missing
trustedTypesPolyfill.installIfNeeded();
}
WorkerScriptLoader.prototype.load = function (moduleManager, scriptSrc, callback, errorback) {
var createTrustedScriptURL = moduleManager.getConfig().getOptionsLiteral().createTrustedScriptURL;
if (createTrustedScriptURL) {
if (!this.scriptSourceURLPolicy) {
this.scriptSourceURLPolicy = trustedTypes.createPolicy('amdLoader', { createScriptURL: createTrustedScriptURL });
}
scriptSrc = this.scriptSourceURLPolicy.createScriptURL(scriptSrc);
}
try {
importScripts(scriptSrc);
callback();