提交 119f19e7 编写于 作者: B Benjamin Pasero

debt - remove jsFlags() from node cached data

上级 c620463a
......@@ -51,9 +51,11 @@ userDefinedLocale.then(locale => {
}
});
// Configure command line switches
// Cached data
const nodeCachedDataDir = getNodeCachedDir();
configureCommandlineSwitches(args, nodeCachedDataDir);
// Configure command line switches
configureCommandlineSwitches(args);
// Load our code once ready
app.once('ready', function () {
......@@ -134,15 +136,14 @@ function onReady() {
* @typedef {import('minimist').ParsedArgs} ParsedArgs
*
* @param {ParsedArgs} cliArgs
* @param {{ jsFlags: () => string }} nodeCachedDataDir
*/
function configureCommandlineSwitches(cliArgs, nodeCachedDataDir) {
function configureCommandlineSwitches(cliArgs) {
// Force pre-Chrome-60 color profile handling (for https://github.com/Microsoft/vscode/issues/51791)
app.commandLine.appendSwitch('disable-color-correct-rendering');
// Support JS Flags
const jsFlags = resolveJSFlags(cliArgs, nodeCachedDataDir.jsFlags());
const jsFlags = getJSFlags(cliArgs);
if (jsFlags) {
app.commandLine.appendSwitch('--js-flags', jsFlags);
}
......@@ -155,10 +156,10 @@ function configureCommandlineSwitches(cliArgs, nodeCachedDataDir) {
/**
* @param {ParsedArgs} cliArgs
* @param {string[]} jsFlags
* @returns {string}
*/
function resolveJSFlags(cliArgs, ...jsFlags) {
function getJSFlags(cliArgs) {
const jsFlags = [];
// Add any existing JS flags we already got from the command line
if (cliArgs['js-flags']) {
......@@ -253,7 +254,7 @@ function registerListeners() {
}
/**
* @returns {{ jsFlags: () => string; ensureExists: () => Promise<string | void>, _compute: () => string; }}
* @returns {{ ensureExists: () => Promise<string | void> }}
*/
function getNodeCachedDir() {
return new class {
......@@ -262,11 +263,6 @@ function getNodeCachedDir() {
this.value = this._compute();
}
jsFlags() {
// return this.value ? '--nolazy' : undefined;
return undefined;
}
ensureExists() {
return bootstrap.mkdirp(this.value).then(() => this.value, () => { /*ignore*/ });
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册