Skip to content

Commit b2ac8d2

Browse files
authored
Merge pull request microsoft#65790 from Microsoft/roblou/removeVoid0
Replace all void 0 with undefined
2 parents 0d11396 + 95b9756 commit b2ac8d2

414 files changed

Lines changed: 1520 additions & 1520 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build/gulpfile.vscode.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,13 @@ const config = {
171171
urlSchemes: [product.urlProtocol]
172172
}],
173173
darwinForceDarkModeSupport: true,
174-
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : void 0,
174+
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : undefined,
175175
linuxExecutableName: product.applicationName,
176176
winIcon: 'resources/win32/code.ico',
177-
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || void 0,
177+
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || undefined,
178178

179179
// @ts-ignore JSON checking: electronRepository is optional
180-
repo: product.electronRepository || void 0
180+
repo: product.electronRepository || undefined
181181
};
182182

183183
function getElectron(arch) {

build/lib/git.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function getVersion(repo: string): string | undefined {
1818
try {
1919
head = fs.readFileSync(headPath, 'utf8').trim();
2020
} catch (e) {
21-
return void 0;
21+
return undefined;
2222
}
2323

2424
if (/^[0-9a-f]{40}$/i.test(head)) {
@@ -28,7 +28,7 @@ export function getVersion(repo: string): string | undefined {
2828
const refMatch = /^ref: (.*)$/.exec(head);
2929

3030
if (!refMatch) {
31-
return void 0;
31+
return undefined;
3232
}
3333

3434
const ref = refMatch[1];
@@ -46,7 +46,7 @@ export function getVersion(repo: string): string | undefined {
4646
try {
4747
refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim();
4848
} catch (e) {
49-
return void 0;
49+
return undefined;
5050
}
5151

5252
const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm;

build/lib/watch/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function handleDeletions() {
1717
});
1818
}
1919

20-
let watch = void 0;
20+
let watch = undefined;
2121

2222
if (!watch) {
2323
watch = process.platform === 'win32' ? require('./watch-win32') : require('gulp-watch');

extensions/css-language-features/server/src/cssServerMain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function getDocumentSettings(textDocument: TextDocument): Thenable<LanguageSetti
126126
}
127127
return promise;
128128
}
129-
return Promise.resolve(void 0);
129+
return Promise.resolve(undefined);
130130
}
131131

132132
// The settings have changed. Is send on server activation as well.

extensions/css-language-features/server/src/languageModelCache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTime
1515
let languageModels: { [uri: string]: { version: number, languageId: string, cTime: number, languageModel: T } } = {};
1616
let nModels = 0;
1717

18-
let cleanupInterval: NodeJS.Timer | undefined = void 0;
18+
let cleanupInterval: NodeJS.Timer | undefined = undefined;
1919
if (cleanupIntervalTimeInSec > 0) {
2020
cleanupInterval = setInterval(() => {
2121
let cutoffTime = Date.now() - cleanupIntervalTimeInSec * 1000;
@@ -73,7 +73,7 @@ export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTime
7373
dispose() {
7474
if (typeof cleanupInterval !== 'undefined') {
7575
clearInterval(cleanupInterval);
76-
cleanupInterval = void 0;
76+
cleanupInterval = undefined;
7777
languageModels = {};
7878
nModels = 0;
7979
}

extensions/css-language-features/server/src/utils/documentContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function getDocumentContext(documentUri: string, workspaceFolders: Worksp
1919
return folderURI;
2020
}
2121
}
22-
return void 0;
22+
return undefined;
2323
}
2424

2525
return {

extensions/git/src/git.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,17 @@ function findGitWin32InPath(onLookup: (path: string) => void): Promise<IGit> {
114114

115115
function findGitWin32(onLookup: (path: string) => void): Promise<IGit> {
116116
return findSystemGitWin32(process.env['ProgramW6432'] as string, onLookup)
117-
.then(void 0, () => findSystemGitWin32(process.env['ProgramFiles(x86)'] as string, onLookup))
118-
.then(void 0, () => findSystemGitWin32(process.env['ProgramFiles'] as string, onLookup))
119-
.then(void 0, () => findSystemGitWin32(path.join(process.env['LocalAppData'] as string, 'Programs'), onLookup))
120-
.then(void 0, () => findGitWin32InPath(onLookup));
117+
.then(undefined, () => findSystemGitWin32(process.env['ProgramFiles(x86)'] as string, onLookup))
118+
.then(undefined, () => findSystemGitWin32(process.env['ProgramFiles'] as string, onLookup))
119+
.then(undefined, () => findSystemGitWin32(path.join(process.env['LocalAppData'] as string, 'Programs'), onLookup))
120+
.then(undefined, () => findGitWin32InPath(onLookup));
121121
}
122122

123123
export function findGit(hint: string | undefined, onLookup: (path: string) => void): Promise<IGit> {
124124
const first = hint ? findSpecificGit(hint, onLookup) : Promise.reject<IGit>(null);
125125

126126
return first
127-
.then(void 0, () => {
127+
.then(undefined, () => {
128128
switch (process.platform) {
129129
case 'darwin': return findGitDarwin(onLookup);
130130
case 'win32': return findGitWin32(onLookup);
@@ -248,7 +248,7 @@ export class GitError {
248248
this.error = data.error;
249249
this.message = data.error.message;
250250
} else {
251-
this.error = void 0;
251+
this.error = undefined;
252252
this.message = '';
253253
}
254254

@@ -308,7 +308,7 @@ function getGitErrorCode(stderr: string): string | undefined {
308308
return GitErrorCodes.InvalidBranchName;
309309
}
310310

311-
return void 0;
311+
return undefined;
312312
}
313313

314314
export class Git {
@@ -1376,15 +1376,15 @@ export class Repository {
13761376
throw new Error('Not in a branch');
13771377
}
13781378

1379-
return { name: result.stdout.trim(), commit: void 0, type: RefType.Head };
1379+
return { name: result.stdout.trim(), commit: undefined, type: RefType.Head };
13801380
} catch (err) {
13811381
const result = await this.run(['rev-parse', 'HEAD']);
13821382

13831383
if (!result.stdout) {
13841384
throw new Error('Error parsing HEAD');
13851385
}
13861386

1387-
return { name: void 0, commit: result.stdout.trim(), type: RefType.Head };
1387+
return { name: undefined, commit: result.stdout.trim(), type: RefType.Head };
13881388
}
13891389
}
13901390

extensions/git/src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function anyEvent<T>(...events: Event<T>[]): Event<T> {
6969
}
7070

7171
export function done<T>(promise: Promise<T>): Promise<void> {
72-
return promise.then<void>(() => void 0);
72+
return promise.then<void>(() => undefined);
7373
}
7474

7575
export function onceEvent<T>(event: Event<T>): Event<T> {

extensions/html-language-features/client/src/tagClosing.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function activateTagClosing(tagProvider: (document: TextDocument, positio
1414
updateEnabledState();
1515
window.onDidChangeActiveTextEditor(updateEnabledState, null, disposables);
1616

17-
let timeout: NodeJS.Timer | undefined = void 0;
17+
let timeout: NodeJS.Timer | undefined = undefined;
1818

1919
function updateEnabledState() {
2020
isEnabled = false;
@@ -26,7 +26,7 @@ export function activateTagClosing(tagProvider: (document: TextDocument, positio
2626
if (!supportedLanguages[document.languageId]) {
2727
return;
2828
}
29-
if (!workspace.getConfiguration(void 0, document.uri).get<boolean>(configName)) {
29+
if (!workspace.getConfiguration(undefined, document.uri).get<boolean>(configName)) {
3030
return;
3131
}
3232
isEnabled = true;
@@ -68,7 +68,7 @@ export function activateTagClosing(tagProvider: (document: TextDocument, positio
6868
}
6969
}
7070
});
71-
timeout = void 0;
71+
timeout = undefined;
7272
}, 100);
7373
}
7474
return Disposable.from(...disposables);

extensions/html-language-features/server/src/htmlServerMain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function getDocumentSettings(textDocument: TextDocument, needsDocumentSettings:
7575
}
7676
return promise;
7777
}
78-
return Promise.resolve(void 0);
78+
return Promise.resolve(undefined);
7979
}
8080

8181
// After the server has started the client sends an initialize request. The server receives

0 commit comments

Comments
 (0)