提交 f0a2aa55 编写于 作者: B Benjamin Pasero

sqlite - fix warnings

上级 982051a3
......@@ -13,6 +13,7 @@ import { IStorageLegacyService, StorageLegacyScope } from 'vs/platform/storage/c
import { addDisposableListener } from 'vs/base/browser/dom';
import { startsWith } from 'vs/base/common/strings';
import { ShutdownReason } from 'vs/platform/lifecycle/common/lifecycle';
import { isUndefinedOrNull } from 'vs/base/common/types';
export class StorageService extends Disposable implements IStorageService {
_serviceBrand: any;
......@@ -132,7 +133,7 @@ export class DelegatingStorageService extends Disposable implements IStorageServ
}
get(key: string, scope: StorageScope, fallbackValue?: any): string {
const dbValue = this.storageService.get(key, scope, fallbackValue);
const dbValue = this.storageService.get(key, scope);
const localStorageValue = this.storageLegacyService.get(key, this.convertScope(scope), fallbackValue);
this.assertStorageValue(key, scope, dbValue, localStorageValue);
......@@ -141,7 +142,7 @@ export class DelegatingStorageService extends Disposable implements IStorageServ
}
getBoolean(key: string, scope: StorageScope, fallbackValue?: boolean): boolean {
const dbValue = this.storageService.getBoolean(key, scope, fallbackValue);
const dbValue = this.storageService.getBoolean(key, scope);
const localStorageValue = this.storageLegacyService.getBoolean(key, this.convertScope(scope), fallbackValue);
this.assertStorageValue(key, scope, dbValue, localStorageValue);
......@@ -150,7 +151,7 @@ export class DelegatingStorageService extends Disposable implements IStorageServ
}
getInteger(key: string, scope: StorageScope, fallbackValue?: number): number {
const dbValue = this.storageService.getInteger(key, scope, fallbackValue);
const dbValue = this.storageService.getInteger(key, scope);
const localStorageValue = this.storageLegacyService.getInteger(key, this.convertScope(scope), fallbackValue);
this.assertStorageValue(key, scope, dbValue, localStorageValue);
......@@ -159,7 +160,7 @@ export class DelegatingStorageService extends Disposable implements IStorageServ
}
private assertStorageValue(key: string, scope: StorageScope, dbValue: any, storageValue: any): void {
if (dbValue && dbValue !== storageValue) {
if (!isUndefinedOrNull(dbValue) && dbValue !== storageValue) {
this.logService.error(`Unexpected storage value (key: ${key}, scope: ${scope === StorageScope.GLOBAL ? 'global' : 'workspace'}), actual: ${dbValue}, expected: ${storageValue}`);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册