mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
Use .?method() in more places (#152112)
Switches simple patterns like:
```ts
if (some.thing) {
some.thing.method();
}
```
to:
```ts
some.thing?.method()
```
This is more concise and avoids having to repeat the `some.thing` part
This commit is contained in:
@@ -86,15 +86,11 @@ class WebWorker implements IWorker {
|
||||
}
|
||||
|
||||
public postMessage(message: any, transfer: Transferable[]): void {
|
||||
if (this.worker) {
|
||||
this.worker.then(w => w.postMessage(message, transfer));
|
||||
}
|
||||
this.worker?.then(w => w.postMessage(message, transfer));
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
if (this.worker) {
|
||||
this.worker.then(w => w.terminate());
|
||||
}
|
||||
this.worker?.then(w => w.terminate());
|
||||
this.worker = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user