Skip to content

Commit 91eaf03

Browse files
committed
Fix some strict property init errors
1 parent 8235163 commit 91eaf03

14 files changed

Lines changed: 49 additions & 49 deletions

File tree

src/vs/base/common/async.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export class Delayer<T> implements IDisposable {
178178
private timeout: any;
179179
private completionPromise: Promise<any> | null;
180180
private doResolve: ((value?: any | Promise<any>) => void) | null;
181-
private doReject: (err: any) => void;
181+
private doReject?: (err: any) => void;
182182
private task: ITask<T | Promise<T>> | null;
183183

184184
constructor(public defaultDelay: number) {
@@ -222,7 +222,7 @@ export class Delayer<T> implements IDisposable {
222222
this.cancelTimeout();
223223

224224
if (this.completionPromise) {
225-
this.doReject(errors.canceled());
225+
this.doReject!(errors.canceled());
226226
this.completionPromise = null;
227227
}
228228
}
@@ -282,7 +282,7 @@ export class Barrier {
282282

283283
private _isOpen: boolean;
284284
private _promise: Promise<boolean>;
285-
private _completePromise: (v: boolean) => void;
285+
private _completePromise!: (v: boolean) => void;
286286

287287
constructor() {
288288
this._isOpen = false;
@@ -731,8 +731,8 @@ export class IdleValue<T> {
731731
private readonly _executor: () => void;
732732
private readonly _handle: IDisposable;
733733

734-
private _didRun: boolean;
735-
private _value: T;
734+
private _didRun: boolean = false;
735+
private _value?: T;
736736
private _error: any;
737737

738738
constructor(executor: () => T) {
@@ -760,7 +760,7 @@ export class IdleValue<T> {
760760
if (this._error) {
761761
throw this._error;
762762
}
763-
return this._value;
763+
return this._value!;
764764
}
765765
}
766766

src/vs/base/common/cancellation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class MutableToken implements CancellationToken {
8787

8888
export class CancellationTokenSource {
8989

90-
private _token: CancellationToken;
90+
private _token?: CancellationToken;
9191

9292
get token(): CancellationToken {
9393
if (!this._token) {

src/vs/base/common/color.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export class Color {
260260
}
261261

262262
readonly rgba: RGBA;
263-
private _hsla: HSLA;
263+
private _hsla?: HSLA;
264264
get hsla(): HSLA {
265265
if (this._hsla) {
266266
return this._hsla;
@@ -269,7 +269,7 @@ export class Color {
269269
}
270270
}
271271

272-
private _hsva: HSVA;
272+
private _hsva?: HSVA;
273273
get hsva(): HSVA {
274274
if (this._hsva) {
275275
return this._hsva;

src/vs/base/common/scrollable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ export class SmoothScrollingOperation {
377377
private readonly _startTime: number;
378378
public animationFrameDisposable: IDisposable | null;
379379

380-
private scrollLeft: IAnimation;
381-
private scrollTop: IAnimation;
380+
private scrollLeft!: IAnimation;
381+
private scrollTop!: IAnimation;
382382

383383
protected constructor(from: ISmoothScrollPosition, to: ISmoothScrollPosition, startTime: number, duration: number) {
384384
this.from = from;

src/vs/base/node/id.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import { TernarySearchTree } from 'vs/base/common/map';
2020
// Sun xVM VirtualBox 08-00-27
2121
export const virtualMachineHint: { value(): number } = new class {
2222

23-
private _virtualMachineOUIs: TernarySearchTree<boolean>;
24-
private _value: number;
23+
private _virtualMachineOUIs?: TernarySearchTree<boolean>;
24+
private _value?: number;
2525

2626
private _isVirtualMachineMacAdress(mac: string): boolean {
2727
if (!this._virtualMachineOUIs) {

src/vs/editor/contrib/codelens/codelensWidget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class CodeLensViewZone implements editorBrowser.IViewZone {
2525

2626
afterLineNumber: number;
2727

28-
private _lastHeight: number;
28+
private _lastHeight?: number;
2929
private readonly _onHeight: Function;
3030

3131
constructor(afterLineNumber: number, onHeight: Function) {

src/vs/editor/contrib/gotoError/gotoError.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ export class MarkerController implements editorCommon.IEditorContribution {
203203
}
204204

205205
private readonly _editor: ICodeEditor;
206-
private _model: MarkerModel | null;
207-
private _widget: MarkerNavigationWidget | null;
206+
private _model: MarkerModel | null = null;
207+
private _widget: MarkerNavigationWidget | null = null;
208208
private readonly _widgetVisible: IContextKey<boolean>;
209209
private _disposeOnClose: IDisposable[] = [];
210210

src/vs/editor/contrib/linesOperations/moveLinesCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class MoveLinesCommand implements ICommand {
2121
private readonly _autoIndent: boolean;
2222

2323
private _selectionId: string;
24-
private _moveEndPositionDown: boolean;
24+
private _moveEndPositionDown?: boolean;
2525
private _moveEndLineSelectionShrink: boolean;
2626

2727
constructor(selection: Selection, isMovingDown: boolean, autoIndent: boolean) {

src/vs/editor/contrib/suggest/suggestAlternatives.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export class SuggestAlternatives {
1818
private _index: number;
1919
private _model: CompletionModel | undefined;
2020
private _acceptNext: ((selected: ISelectedSuggestion) => any) | undefined;
21-
private _listener: IDisposable;
22-
private _ignore: boolean;
21+
private _listener: IDisposable | undefined;
22+
private _ignore: boolean | undefined;
2323

2424
constructor(
2525
private readonly _editor: ICodeEditor,

src/vs/editor/test/browser/editorTestServices.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { IResourceInput } from 'vs/platform/editor/common/editor';
1313
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
1414

1515
export class TestCodeEditorService extends AbstractCodeEditorService {
16-
public lastInput: IResourceInput;
16+
public lastInput?: IResourceInput;
1717
public getActiveCodeEditor(): ICodeEditor | null { return null; }
1818
public openCodeEditor(input: IResourceInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null> {
1919
this.lastInput = input;

0 commit comments

Comments
 (0)