Skip to content

Commit 4370118

Browse files
committed
isString -> isStringOrBlock
1 parent bc5f081 commit 4370118

File tree

1 file changed

+9
-9
lines changed
  • src/lib/ruby-to-blocks-converter

1 file changed

+9
-9
lines changed

src/lib/ruby-to-blocks-converter/wedo2.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const Wedo2Converter = {
1111
if ((this._isSelf(receiver) || receiver === Opal.nil) && !rubyBlock) {
1212
switch (name) {
1313
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])) {
1515
block = this._createBlock('wedo2_motorOnFor', 'statement');
1616
this._addInput(
1717
block,
@@ -22,7 +22,7 @@ const Wedo2Converter = {
2222
}
2323
break;
2424
case 'wedo2_trun_motor_on':
25-
if (args.length === 1 && this._isString(args[0])) {
25+
if (args.length === 1 && this._isStringOrBlock(args[0])) {
2626
block = this._createBlock('wedo2_motorOn', 'statement');
2727
this._addInput(
2828
block,
@@ -32,7 +32,7 @@ const Wedo2Converter = {
3232
}
3333
break;
3434
case 'wedo2_trun_motor_off':
35-
if (args.length === 1 && this._isString(args[0])) {
35+
if (args.length === 1 && this._isStringOrBlock(args[0])) {
3636
block = this._createBlock('wedo2_motorOff', 'statement');
3737
this._addInput(
3838
block,
@@ -42,7 +42,7 @@ const Wedo2Converter = {
4242
}
4343
break;
4444
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])) {
4646
block = this._createBlock('wedo2_startMotorPower', 'statement');
4747
this._addInput(
4848
block,
@@ -53,7 +53,7 @@ const Wedo2Converter = {
5353
}
5454
break;
5555
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])){
5757
block = this._createBlock('wedo2_setMotorDirection', 'statement');
5858
this._addInput(
5959
block,
@@ -79,7 +79,7 @@ const Wedo2Converter = {
7979
}
8080
break;
8181
case 'wedo2_tilted':
82-
if (args.length === 1 && this._isString(args[0])) {
82+
if (args.length === 1 && this._isStringOrBlock(args[0])) {
8383
block = this._createBlock('wedo2_isTilted', 'value');
8484
this._addInput(
8585
block,
@@ -89,7 +89,7 @@ const Wedo2Converter = {
8989
}
9090
break;
9191
case 'wedo2_tilt_angle':
92-
if (args.length === 1 && this._isString(args[0])) {
92+
if (args.length === 1 && this._isStringOrBlock(args[0])) {
9393
block = this._createBlock('wedo2_getTiltAngle', 'value');
9494
this._addInput(
9595
block,
@@ -106,7 +106,7 @@ const Wedo2Converter = {
106106
rubyBlock) {
107107
switch (name) {
108108
case 'wedo2_when_tilted':
109-
if (args.length === 1 && this._isString(args[0])) {
109+
if (args.length === 1 && this._isStringOrBlock(args[0])) {
110110
block = this._createBlock('wedo2_whenTilted', 'hat');
111111
this._addInput(
112112
block,
@@ -117,7 +117,7 @@ const Wedo2Converter = {
117117
}
118118
break;
119119
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])) {
121121
block = this._createBlock('wedo2_whenDistance', 'hat');
122122
this._addInput(
123123
block,

0 commit comments

Comments
 (0)