8000 fix: avoid unnecessary usage of Array.prototype.reverse() · NativeScript/NativeScript@efb1a93 · GitHub
[go: up one dir, main page]

Skip to content

Commit efb1a93

Browse files
committed
fix: avoid unnecessary usage of Array.prototype.reverse()
1 parent 217cd78 commit efb1a93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/data/dom-events/dom-event.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ export class DOMEvent implements Event {
300300

301301
// Bubbling phase, e.g. [Button, StackLayout, Page]
302302
// It's correct to dispatch the event to the target during both phases.
303-
for (const currentTarget of eventPath.reverse()) {
304-
this.currentTarget = currentTarget;
303+
for (let i = eventPath.length - 1; i >= 0; i--) {
304+
const currentTarget = eventPath[i];
305305
this.eventPhase = this.target === this.currentTarget ? this.AT_TARGET : this.BUBBLING_PHASE;
306306

307307
this.handleEvent({

0 commit comments

Comments
 (0)
0