@@ -26,9 +26,9 @@ const input = require('./input')
26
26
* @return {!Array } .
27
27
*/
28
28
function flatten ( args ) {
29
- let result = [ ]
29
+ const result = [ ]
30
30
for ( let i = 0 ; i < args . length ; i ++ ) {
31
- let element = args [ i ]
31
+ const element = args [ i ]
32
32
if ( Array . isArray ( element ) ) {
33
33
result . push . apply ( result , flatten ( element ) )
34
34
} else {
@@ -119,8 +119,8 @@ class LegacyActionSequence {
119
119
// Make a protected copy of the scheduled actions. This will protect against
120
120
// users defining additional commands before this sequence is actually
121
121
// executed.
122
- let actions = this . actions_ . concat ( )
123
- for ( let action of actions ) {
122
+ const actions = this . actions_ . concat ( )
123
+ for ( const action of actions ) {
124
124
await this . driver_ . execute ( action . command )
125
125
}
126
126
}
@@ -141,7 +141,7 @@ class LegacyActionSequence {
141
141
* @return {!LegacyActionSequence } A self reference.
142
142
*/
143
143
mouseMove ( location , opt_offset ) {
144
- let cmd = new command . Command ( command . Name . LEGACY_ACTION_MOUSE_MOVE )
144
+ const cmd = new command . Command ( command . Name . LEGACY_ACTION_MOUSE_MOVE )
145
145
146
146
if ( typeof location . x === 'number' ) {
147
147
setOffset ( /** @type {{x: number, y: number} } */ ( location ) )
@@ -389,8 +389,9 @@ class LegacyActionSequence {
389
389
* @return {!LegacyActionSequence } A self reference.
390
390
* @throws {Error } If the key is not a valid modifier key.
391
391
*/
392
- sendKeys ( var_args ) { // eslint-disable-line
393
- let keys = flatten ( arguments )
392
+ sendKeys ( _var_args ) {
393
+ // eslint-disable-line
394
+ const keys = flatten ( arguments )
394
395
return this . scheduleKeyboardAction_ ( 'sendKeys' , keys )
395
396
}
396
397
}
@@ -481,7 +482,7 @@ class LegacyTouchSequence {
481
482
* @return {!LegacyTouchSequence } A self reference.
482
483
*/
483
484
doubleTap ( elem ) {
484
- let cmd = new command . Command (
485
+ const cmd = new command . Command (
485
486
command . Name . LEGACY_ACTION_TOUCH_DOUBLE_TAP
486
487
) . setParameter ( 'element' , elem . getId ( ) )
487
488
@@ -496,7 +497,7 @@ class LegacyTouchSequence {
496
497
* @return {!LegacyTouchSequence } A self reference.
497
498
*/
498
499
longPress ( elem ) {
499
- let cmd = new command . Command (
500
+ const cmd = new command . Command (
500
501
command . Name . LEGACY_ACTION_TOUCH_LONG_PRESS
501
502
) . setParameter ( 'element' , elem . getId ( ) )
502
503
@@ -511,7 +512,7 @@ class LegacyTouchSequence {
511
512
* @return {!LegacyTouchSequence } A self reference.
512
513
*/
513
514
tapAndHold ( location ) {
514
- let cmd = new command . Command ( command . Name . LEGACY_ACTION_TOUCH_DOWN )
515
+ const cmd = new command . Command ( command . Name . LEGACY_ACTION_TOUCH_DOWN )
515
516
. setParameter ( 'x' , location . x )
516
517
. setParameter ( 'y' , location . y )
517
518
@@ -526,7 +527,7 @@ class LegacyTouchSequence {
526
527
* @return {!LegacyTouchSequence } A self reference.
527
528
*/
528
529
move ( location ) {
529
- let cmd = new command . Command ( command . Name . LEGACY_ACTION_TOUCH_MOVE )
530
+ const cmd = new command . Command ( command . Name . LEGACY_ACTION_TOUCH_MOVE )
530
531
. setParameter ( 'x' , location . x )
531
532
. setParameter ( 'y' , location . y )
532
533
@@ -556,7 +557,7 @@ class LegacyTouchSequence {
556
557
* @return {!LegacyTouchSequence } A self reference.
557
558
*/
558
559
scroll ( offset ) {
559
- let cmd = new command . Command ( command . Name . LEGACY_ACTION_TOUCH_SCROLL )
560
+ const cmd = new command . Command ( command . Name . LEGACY_ACTION_TOUCH_SCROLL )
560
561
. setParameter ( 'xoffset' , offset . x )
561
562
. setParameter ( 'yoffset' , offset . y )
562
563
@@ -573,7 +574,7 @@ class LegacyTouchSequence {
573
574
* @return {!LegacyTouchSequence } A self reference.
574
575
*/
575
576
scrollFromElement ( elem , offset ) {
576
- let cmd = new command . Command ( command . Name . LEGACY_ACTION_TOUCH_SCROLL )
577
+ const cmd = new command . Command ( command . Name . LEGACY_ACTION_TOUCH_SCROLL )
577
578
. setParameter ( 'element' , elem . getId ( ) )
578
579
. setParameter ( 'xoffset' , offset . x )
579
580
. setParameter ( 'yoffset' , offset . y )
@@ -590,7 +591,7 @@ class LegacyTouchSequence {
590
591
* @return {!LegacyTouchSequence } A self reference.
591
592
*/
592
593
flick ( speed ) {
593
- let cmd = new command . Command ( command . Name . LEGACY_ACTION_TOUCH_FLICK )
594
+ const cmd = new command . Command ( command . Name . LEGACY_ACTION_TOUCH_FLICK )
594
595
. setParameter ( 'xspeed' , speed . xspeed )
595
596
. setParameter ( 'yspeed' , speed . yspeed )
596
597
@@ -607,7 +608,7 @@ class LegacyTouchSequence {
607
608
* @return {!LegacyTouchSequence } A self reference.
608
609
*/
609
610
flickElement ( elem , offset , speed ) {
610
- let cmd = new command . Command ( command . Name . LEGACY_ACTION_TOUCH_FLICK )
611
+ const cmd = new command . Command ( command . Name . LEGACY_ACTION_TOUCH_FLICK )
611
612
. setParameter ( 'element' , elem . getId ( ) )
612
613
. setParameter ( 'xoffset' , offset . x )
613
614
. setParameter ( 'yoffset' , offset . y )
0 commit comments