@@ -11,7 +11,7 @@ const Wedo2Converter = {
11
11
if ( ( this . _isSelf ( receiver ) || receiver === Opal . nil ) && ! rubyBlock ) {
12
12
switch ( name ) {
13
13
case 'wedo2_turn_motor_on_for' :
14
- if ( args . length === 2 && this . _isString ( args [ 0 ] ) && this . _isNumberOrBlock ( args [ 1 ] ) ) {
14
+ if ( args . length === 2 && this . _isStringOrBlock ( args [ 0 ] ) && this . _isNumberOrBlock ( args [ 1 ] ) ) {
15
15
block = this . _createBlock ( 'wedo2_motorOnFor' , 'statement' ) ;
16
16
this . _addInput (
17
17
block ,
@@ -22,7 +22,7 @@ const Wedo2Converter = {
22
22
}
23
23
break ;
24
24
case 'wedo2_trun_motor_on' :
25
- if ( args . length === 1 && this . _isString ( args [ 0 ] ) ) {
25
+ if ( args . length === 1 && this . _isStringOrBlock ( args [ 0 ] ) ) {
26
26
block = this . _createBlock ( 'wedo2_motorOn' , 'statement' ) ;
27
27
this . _addInput (
28
28
block ,
@@ -32,7 +32,7 @@ const Wedo2Converter = {
32
32
}
33
33
break ;
34
34
case 'wedo2_trun_motor_off' :
35
- if ( args . length === 1 && this . _isString ( args [ 0 ] ) ) {
35
+ if ( args . length === 1 && this . _isStringOrBlock ( args [ 0 ] ) ) {
36
36
block = this . _createBlock ( 'wedo2_motorOff' , 'statement' ) ;
37
37
this . _addInput (
38
38
block ,
@@ -42,7 +42,7 @@ const Wedo2Converter = {
42
42
}
43
43
break ;
44
44
case 'wedo2_set_motor_power' :
45
- if ( args . length === 2 && this . _isString ( args [ 0 ] ) && this . _isNumberOrBlock ( args [ 1 ] ) ) {
45
+ if ( args . length === 2 && this . _isStringOrBlock ( args [ 0 ] ) && this . _isNumberOrBlock ( args [ 1 ] ) ) {
46
46
block = this . _createBlock ( 'wedo2_startMotorPower' , 'statement' ) ;
47
47
this . _addInput (
48
48
block ,
@@ -53,7 +53,7 @@ const Wedo2Converter = {
53
53
}
54
54
break ;
55
55
case 'wedo2_set_motor_direction' :
56
- if ( args . length === 2 && this . _isString ( args [ 0 ] ) && this . _isString ( args [ 1 ] ) ) {
56
+ if ( args . length === 2 && this . _isStringOrBlock ( args [ 0 ] ) && this . _isStringOrBlock ( args [ 1 ] ) ) {
57
57
block = this . _createBlock ( 'wedo2_setMotorDirection' , 'statement' ) ;
58
58
this . _addInput (
59
59
block ,
@@ -79,7 +79,7 @@ const Wedo2Converter = {
79
79
}
80
80
break ;
81
81
case 'wedo2_tilted' :
82
- if ( args . length === 1 && this . _isString ( args [ 0 ] ) ) {
82
+ if ( args . length === 1 && this . _isStringOrBlock ( args [ 0 ] ) ) {
83
83
block = this . _createBlock ( 'wedo2_isTilted' , 'value' ) ;
84
84
this . _addInput (
85
85
block ,
@@ -89,7 +89,7 @@ const Wedo2Converter = {
89
89
}
90
90
break ;
91
91
case 'wedo2_tilt_angle' :
92
- if ( args . length === 1 && this . _isString ( args [ 0 ] ) ) {
92
+ if ( args . length === 1 && this . _isStringOrBlock ( args [ 0 ] ) ) {
93
93
block = this . _createBlock ( 'wedo2_getTiltAngle' , 'value' ) ;
94
94
this . _addInput (
95
95
block ,
@@ -106,7 +106,7 @@ const Wedo2Converter = {
106
106
rubyBlock ) {
107
107
switch ( name ) {
108
108
case 'wedo2_when_tilted' :
109
- if ( args . length === 1 && this . _isString ( args [ 0 ] ) ) {
109
+ if ( args . length === 1 && this . _isStringOrBlock ( args [ 0 ] ) ) {
110
110
block = this . _createBlock ( 'wedo2_whenTilted' , 'hat' ) ;
111
111
this . _addInput (
112
112
block ,
@@ -117,7 +117,7 @@ const Wedo2Converter = {
117
117
}
118
118
break ;
119
119
case 'wedo2_when_distance' :
120
- if ( args . length === 2 && this . _isString ( args [ 0 ] ) && this . _isNumberOrBlock ( args [ 1 ] ) ) {
120
+ if ( args . length === 2 && this . _isStringOrBlock ( args [ 0 ] ) && this . _isNumberOrBlock ( args [ 1 ] ) ) {
121
121
block = this . _createBlock ( 'wedo2_whenDistance' , 'hat' ) ;
122
122
this . _addInput (
123
123
block ,
0 commit comments