mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-24 00:05:46 +01:00
strict null checks: several ipc utils
This commit is contained in:
@@ -19,14 +19,14 @@ export class WorkspacesChannel implements IWorkspacesChannel {
|
||||
constructor(private service: IWorkspacesMainService) { }
|
||||
|
||||
listen<T>(event: string, arg?: any): Event<T> {
|
||||
throw new Error('No events');
|
||||
throw new Error(`Event not found: ${event}`);
|
||||
}
|
||||
|
||||
call(command: string, arg?: any): Thenable<any> {
|
||||
switch (command) {
|
||||
case 'createWorkspace': {
|
||||
const rawFolders: IWorkspaceFolderCreationData[] = arg;
|
||||
let folders: IWorkspaceFolderCreationData[];
|
||||
let folders: IWorkspaceFolderCreationData[] | undefined = undefined;
|
||||
if (Array.isArray(rawFolders)) {
|
||||
folders = rawFolders.map(rawFolder => {
|
||||
return {
|
||||
@@ -40,7 +40,7 @@ export class WorkspacesChannel implements IWorkspacesChannel {
|
||||
}
|
||||
}
|
||||
|
||||
return void 0;
|
||||
throw new Error(`Call not found: ${command}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user