提交 68a4e012 编写于 作者: M Matt Bierner

Use resolve(void 0) instead of resolve(null) for void promises

Fixes a common type error
上级 6b892478
......@@ -448,7 +448,7 @@ suite('Event utils', () => {
e(err);
}
c(null);
c(void 0);
});
setTimeout(() => emitter.fire(), 10);
......
......@@ -591,7 +591,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
if (error) {
e(error.toString());
} else {
c(null);
c(void 0);
}
// after tests have run, we shutdown the host
......
......@@ -606,7 +606,7 @@ export class DebugService implements IDebugService {
this.launchOrAttachToSession(session, shouldFocus).then(() => {
this._onDidNewSession.fire(session);
c(null);
c(void 0);
}, err => e(err));
});
});
......@@ -727,7 +727,7 @@ export class DebugService implements IDebugService {
if (task.isBackground) {
return new Promise((c, e) => once(e => e.kind === TaskEventKind.Inactive && e.taskId === task._id, this.taskService.onDidStateChange)(() => {
taskStarted = true;
c(null);
c(void 0);
}));
}
......
......@@ -854,7 +854,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
fetchPromise = new Promise((c, e) => {
setTimeout(() => {
Promise.all([this.fetchExecutableRecommendations(), this.fetchDynamicWorkspaceRecommendations()]).then(() => c(null));
Promise.all([this.fetchExecutableRecommendations(), this.fetchDynamicWorkspaceRecommendations()]).then(() => c(void 0));
}, calledDuringStartup ? 10000 : 0);
});
......
......@@ -1219,7 +1219,7 @@ suite('ExtensionsWorkbenchServiceTest', () => {
let counter = 0;
event(() => {
if (++counter === count) {
c(null);
c(void 0);
}
});
});
......
......@@ -129,9 +129,9 @@ suite('ConfigurationEditingService', () => {
function clearWorkspace(): Promise<void> {
return new Promise<void>((c, e) => {
if (parentDir) {
extfs.del(parentDir, os.tmpdir(), () => c(null), () => c(null));
extfs.del(parentDir, os.tmpdir(), () => c(void 0), () => c(void 0));
} else {
c(null);
c(void 0);
}
}).then(() => parentDir = null);
}
......
......@@ -111,9 +111,9 @@ suite('KeybindingsEditing', () => {
teardown(() => {
return new Promise<void>((c, e) => {
if (testDir) {
extfs.del(testDir, os.tmpdir(), () => c(null), () => c(null));
extfs.del(testDir, os.tmpdir(), () => c(void 0), () => c(void 0));
} else {
c(null);
c(void 0);
}
}).then(() => testDir = null);
});
......
......@@ -219,7 +219,7 @@ suite('ExtHostTreeView', function () {
label: { label: 'b' },
collapsibleState: TreeItemCollapsibleState.Collapsed
});
c(null);
c(void 0);
});
onDidChangeTreeNode.fire(getNode('b'));
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册