mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
do not send falsify values to the renderer
This commit is contained in:
parent
69df5034e4
commit
5d81e5eb8e
|
@ -153,7 +153,7 @@ export class EnvService implements IEnvService {
|
|||
|
||||
this._cliArgs = Object.freeze({
|
||||
_: [],
|
||||
pathArguments: pathArguments,
|
||||
pathArguments,
|
||||
timestamp: types.isNumber(timestamp) ? String(timestamp) : '0',
|
||||
performance: argv.performance,
|
||||
verbose: argv.verbose,
|
||||
|
|
|
@ -397,6 +397,11 @@ export class VSCodeWindow {
|
|||
// Config (combination of process.argv and window configuration)
|
||||
const environment = parseArgs(process.argv);
|
||||
const config = objects.assign(environment, windowConfiguration);
|
||||
for (let key in config) {
|
||||
if (!config[key]) {
|
||||
delete config[key]; // only send over properties that have a true value
|
||||
}
|
||||
}
|
||||
|
||||
url += '?config=' + encodeURIComponent(JSON.stringify(config));
|
||||
|
||||
|
|
|
@ -50,8 +50,7 @@ function createScript(src, onload) {
|
|||
}
|
||||
|
||||
function uriFromPath(_path) {
|
||||
var pathName = path.resolve(_path).replace(/\\/g, '/');
|
||||
|
||||
let pathName = path.resolve(_path).replace(/\\/g, '/');
|
||||
if (pathName.length > 0 && pathName.charAt(0) !== '/') {
|
||||
pathName = '/' + pathName;
|
||||
}
|
||||
|
@ -93,13 +92,12 @@ function main() {
|
|||
const webFrame = require('electron').webFrame;
|
||||
const args = parseURLQueryArgs();
|
||||
const configuration = JSON.parse(args['config'] || '{}') || {};
|
||||
const enableDeveloperTools = process.env['VSCODE_DEV'] || !!configuration.extensionDevelopmentPath;
|
||||
|
||||
// Correctly inherit the parent's environment
|
||||
assign(process.env, configuration.userEnv);
|
||||
|
||||
// Get the nls configuration into the process.env as early as possible.
|
||||
var nlsConfig = { availableLanguages: {} };
|
||||
let nlsConfig = { availableLanguages: {} };
|
||||
const config = process.env['VSCODE_NLS_CONFIG'];
|
||||
if (config) {
|
||||
process.env['VSCODE_NLS_CONFIG'] = config;
|
||||
|
@ -108,8 +106,7 @@ function main() {
|
|||
} catch (e) { /*noop*/ }
|
||||
}
|
||||
|
||||
var locale = nlsConfig.availableLanguages['*'] || 'en';
|
||||
|
||||
let locale = nlsConfig.availableLanguages['*'] || 'en';
|
||||
if (locale === 'zh-tw') {
|
||||
locale = 'zh-Hant';
|
||||
} else if (locale === 'zh-cn') {
|
||||
|
@ -118,6 +115,7 @@ function main() {
|
|||
|
||||
window.document.documentElement.setAttribute('lang', locale);
|
||||
|
||||
const enableDeveloperTools = process.env['VSCODE_DEV'] || !!configuration.extensionDevelopmentPath;
|
||||
registerListeners(enableDeveloperTools);
|
||||
|
||||
// We get the global settings through a remote call from the browser
|
||||
|
@ -161,7 +159,7 @@ function main() {
|
|||
start: new Date()
|
||||
};
|
||||
|
||||
if (!!configuration.performance) {
|
||||
if (configuration.performance) {
|
||||
const programStart = remote.getGlobal('programStart');
|
||||
const vscodeStart = remote.getGlobal('vscodeStart');
|
||||
|
||||
|
|
Loading…
Reference in a new issue