Prefer to use .then(void 0, ..) over .then(null, ..)

ES6 promises like using undefined as their first argument instead of null. Both should behave the same behavior
This commit is contained in:
Matt Bierner
2018-12-11 21:59:32 -08:00
parent a256e72786
commit 0b1d0da7af
39 changed files with 78 additions and 78 deletions

View File

@@ -319,7 +319,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
// call deactivate if available
try {
if (typeof extension.module.deactivate === 'function') {
result = Promise.resolve(extension.module.deactivate()).then(null, (err) => {
result = Promise.resolve(extension.module.deactivate()).then(void 0, (err) => {
// TODO: Do something with err if this is not the shutdown case
return Promise.resolve(void 0);
});
@@ -465,7 +465,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
// Handle "eager" activation extensions
private _handleEagerExtensions(): Promise<void> {
this._activateByEvent('*', true).then(null, (err) => {
this._activateByEvent('*', true).then(void 0, (err) => {
console.error(err);
});
@@ -522,7 +522,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
// the file was found
return (
this._activateById(extensionId, new ExtensionActivatedByEvent(true, `workspaceContains:${fileName}`))
.then(null, err => console.error(err))
.then(void 0, err => console.error(err))
);
}
}
@@ -543,7 +543,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
const timer = setTimeout(async () => {
tokenSource.cancel();
this._activateById(extensionId, new ExtensionActivatedByEvent(true, `workspaceContainsTimeout:${globPatterns.join(',')}`))
.then(null, err => console.error(err));
.then(void 0, err => console.error(err));
}, ExtHostExtensionService.WORKSPACE_CONTAINS_TIMEOUT);
let exists: boolean;
@@ -562,7 +562,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
// a file was found matching one of the glob patterns
return (
this._activateById(extensionId, new ExtensionActivatedByEvent(true, `workspaceContains:${globPatterns.join(',')}`))
.then(null, err => console.error(err))
.then(void 0, err => console.error(err))
);
}