提交 bb658ff1 编写于 作者: B Benjamin Pasero

let => const

上级 955aa315
......@@ -44,7 +44,7 @@ export class Win32AutoUpdaterImpl extends EventEmitter {
}
get cachePath(): TPromise<string> {
let result = path.join(tmpdir(), 'vscode-update');
const result = path.join(tmpdir(), 'vscode-update');
return new TPromise<string>((c, e) => mkdirp(result, null, err => err ? e(err) : c(result)));
}
......
......@@ -91,7 +91,7 @@ export class EnvService implements IEnvService {
this._appKeybindingsPath = path.join(this._appSettingsHome, 'keybindings.json');
// Remove the Electron executable
let [, ...args] = process.argv;
const [, ...args] = process.argv;
// If dev, remove the first non-option argument: it's the app location
if (!this.isBuilt) {
......@@ -205,14 +205,14 @@ export interface IParsedPath {
}
export function parseLineAndColumnAware(rawPath: string): IParsedPath {
let segments = rawPath.split(':'); // C:\file.txt:<line>:<column>
const segments = rawPath.split(':'); // C:\file.txt:<line>:<column>
let path: string;
let line: number = null;
let column: number = null;
segments.forEach(segment => {
let segmentAsNumber = Number(segment);
const segmentAsNumber = Number(segment);
if (!types.isNumber(segmentAsNumber)) {
path = !!path ? [path, segment].join(':') : segment; // a colon can well be part of a path (e.g. C:\...)
} else if (line === null) {
......@@ -234,7 +234,7 @@ export function parseLineAndColumnAware(rawPath: string): IParsedPath {
}
function toLineAndColumnPath(parsedPath: IParsedPath): string {
let segments = [parsedPath.path];
const segments = [parsedPath.path];
if (types.isNumber(parsedPath.line)) {
segments.push(String(parsedPath.line));
......
......@@ -119,7 +119,7 @@ export class LifecycleService implements ILifecycleService {
// Window Before Closing: Main -> Renderer
vscodeWindow.win.on('close', (e) => {
let windowId = vscodeWindow.id;
const windowId = vscodeWindow.id;
this.logService.log('Lifecycle#window-before-close', windowId);
// The window already acknowledged to be closed
......@@ -155,9 +155,9 @@ export class LifecycleService implements ILifecycleService {
this.logService.log('Lifecycle#unload()', vscodeWindow.id);
return new TPromise<boolean>((c) => {
let oneTimeEventToken = this.oneTimeListenerTokenGenerator++;
let oneTimeOkEvent = 'vscode:ok' + oneTimeEventToken;
let oneTimeCancelEvent = 'vscode:cancel' + oneTimeEventToken;
const oneTimeEventToken = this.oneTimeListenerTokenGenerator++;
const oneTimeOkEvent = 'vscode:ok' + oneTimeEventToken;
const oneTimeCancelEvent = 'vscode:cancel' + oneTimeEventToken;
ipc.once(oneTimeOkEvent, () => {
c(false); // no veto
......
......@@ -19,7 +19,7 @@ export class MainLogService implements ILogService {
_serviceBrand: any;
constructor( @IEnvService private envService: IEnvService) {
constructor(@IEnvService private envService: IEnvService) {
}
log(...args: any[]): void {
......
......@@ -76,7 +76,7 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: IProce
if (err) {
// take only the message and stack property
let friendlyError = {
const friendlyError = {
message: err.message,
stack: err.stack
};
......
此差异已折叠。
......@@ -26,7 +26,7 @@ function _spawnSharedProcess(options: ISharedProcessOptions): cp.ChildProcess {
}
if (options.debugPort) {
execArgv.push(`--debug=${ options.debugPort }`);
execArgv.push(`--debug=${options.debugPort}`);
}
const result = cp.fork(boostrapPath, ['--type=SharedProcess'], { env, execArgv });
......
......@@ -68,7 +68,7 @@ export class StorageService implements IStorageService {
}
}
let oldValue = this.database[key];
const oldValue = this.database[key];
this.database[key] = data;
this.save();
......@@ -81,7 +81,7 @@ export class StorageService implements IStorageService {
}
if (this.database[key]) {
let oldValue = this.database[key];
const oldValue = this.database[key];
delete this.database[key];
this.save();
......
......@@ -131,7 +131,7 @@ export class UpdateManager extends EventEmitter implements IUpdateService {
});
this.raw.on('update-downloaded', (event: any, releaseNotes: string, version: string, date: Date, url: string, rawQuitAndUpdate: () => void) => {
let data: IUpdate = {
const data: IUpdate = {
releaseNotes: releaseNotes,
version: version,
date: date,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册