Fix/supressing more implicit index errors

#76442
This commit is contained in:
Matt Bierner
2019-07-08 18:36:33 -07:00
parent 6824cc9023
commit 3492642650
4 changed files with 9 additions and 5 deletions
+4 -1
View File
@@ -131,7 +131,10 @@ export function log(entry: IRemoteConsoleLog, label: string): void {
}
// Log it
console[entry.severity].apply(console, consoleArgs);
if (typeof (console as any)[entry.severity] !== 'function') {
throw new Error('Unknown console method');
}
(console as any)[entry.severity].apply(console, consoleArgs);
}
function color(color: string): string {
+1 -1
View File
@@ -237,7 +237,7 @@ export class SQLiteStorageDatabase implements IStorageDatabase {
const connection = await this.whenConnected;
const row = await this.get(connection, full ? 'PRAGMA integrity_check' : 'PRAGMA quick_check');
const integrity = full ? row['integrity_check'] : row['quick_check'];
const integrity = full ? (row as any)['integrity_check'] : (row as any)['quick_check'];
if (connection.isErroneous) {
return `${integrity} (last error: ${connection.lastError})`;
@@ -29,8 +29,8 @@ export class Query {
if (hasSort && command === 'sort' || hasCategory && command === 'category') {
return [];
}
if (subcommands[command]) {
return subcommands[command].map((subcommand: string) => `@${command}:${subcommand}${subcommand === '' ? '' : ' '}`);
if ((subcommands as any)[command]) {
return (subcommands as any)[command].map((subcommand: string) => `@${command}:${subcommand}${subcommand === '' ? '' : ' '}`);
}
else {
return [`@${command} `];
@@ -21,6 +21,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { ViewletDescriptor } from 'vs/workbench/browser/viewlet';
import { Registry } from 'vs/platform/registry/common/platform';
import { CancellationToken } from 'vs/base/common/cancellation';
import { IStringDictionary } from 'vs/base/common/collections';
export const VIEW_PICKER_PREFIX = 'view ';
@@ -101,7 +102,7 @@ export class ViewPickerHandler extends QuickOpenHandler {
return true;
});
const entryToCategory = {};
const entryToCategory: IStringDictionary<string> = {};
entries.forEach(e => {
if (!entryToCategory[e.getLabel()]) {
entryToCategory[e.getLabel()] = e.getCategory();