Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/lib/ruby-to-blocks-converter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ class RubyToBlocksConverter {
if (block.fields[before]) {
block.fields[after] = block.fields[before];
block.fields[after].name = after;
block.fields[after].variableType = varType;
delete block.fields[before];

const varName = block.fields[after].value;
Expand Down Expand Up @@ -668,7 +669,8 @@ class RubyToBlocksConverter {
VARIABLE: {
name: 'VARIABLE',
id: variable.id,
value: variable.name
value: variable.name,
variableType: Variable.SCALAR_TYPE
}
}
});
Expand All @@ -694,7 +696,8 @@ class RubyToBlocksConverter {
LIST: {
name: 'LIST',
id: variable.id,
value: variable.name
value: variable.name,
variableType: Variable.LIST_TYPE
}
}
});
Expand Down Expand Up @@ -1156,7 +1159,8 @@ class RubyToBlocksConverter {
VARIABLE: {
name: 'VARIABLE',
id: variable.id,
value: variable.name
value: variable.name,
variableType: Variable.SCALAR_TYPE
}
}
});
Expand Down Expand Up @@ -1262,7 +1266,8 @@ class RubyToBlocksConverter {
[name]: {
name: name,
id: variable.id,
value: variable.name
value: variable.name,
variableType: variable.type
}
}
});
Expand Down Expand Up @@ -1294,7 +1299,8 @@ class RubyToBlocksConverter {
VARIABLE: {
name: 'VARIABLE',
id: variable.id,
value: variable.name
value: variable.name,
variableType: Variable.SCALAR_TYPE
}
}
});
Expand Down
1 change: 1 addition & 0 deletions test/helpers/expect-to-equal-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const expectToEqualFields = function (context, actualFields, expectedFieldsInfo)
expectedType = Variable.LIST_TYPE;
}
expect(variable.type).toEqual(expectedType);
expect(field).toHaveProperty('variableType', expectedType);
} else {
expect(field.id).toEqual(void 0);
expect(field.value).toEqual(expectedField.value);
Expand Down