mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 04:23:32 +01:00
Use optional method calls in more places (#151634)
This replaces code like:
```ts
if (foo.bar) {
foo.bar(cat);
}
```
with:
```ts
foo.bar?.(cat)
```
Which is more concise but has the same meaning
This commit is contained in:
@@ -1733,9 +1733,7 @@ export class DragAndDropObserver extends Disposable {
|
||||
this._register(addDisposableListener(this.element, EventType.DRAG_OVER, (e: DragEvent) => {
|
||||
e.preventDefault(); // needed so that the drop event fires (https://stackoverflow.com/questions/21339924/drop-event-not-firing-in-chrome)
|
||||
|
||||
if (this.callbacks.onDragOver) {
|
||||
this.callbacks.onDragOver(e, e.timeStamp - this.dragStartTime);
|
||||
}
|
||||
this.callbacks.onDragOver?.(e, e.timeStamp - this.dragStartTime);
|
||||
}));
|
||||
|
||||
this._register(addDisposableListener(this.element, EventType.DRAG_LEAVE, (e: DragEvent) => {
|
||||
|
||||
Reference in New Issue
Block a user