mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
fix: Fix bug that could caused variable map to be left in an inconsistent state. (#9339)
This commit is contained in:
@@ -258,6 +258,13 @@ suite('Variable Map', function () {
|
||||
assert.deepEqual(newTypeVariables, [variable]);
|
||||
assert.equal(variable.getType(), '');
|
||||
});
|
||||
|
||||
test('removes the type from the map when the last instance is changed', function () {
|
||||
const var1 = this.variableMap.createVariable('name1', 'type1');
|
||||
const var2 = this.variableMap.createVariable('name2', 'type2');
|
||||
this.variableMap.changeVariableType(var1, 'type2');
|
||||
assert.deepEqual(this.variableMap.getTypes(), ['type2']);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user