@@ -47,12 +47,12 @@ suite('Procedures', function () {
4747 this . eventSpy = this . sandbox . spy ( ) ;
4848 this . workspace . addChangeListener ( this . eventSpy ) ;
4949
50- this . workspace . createVariable ( 'preCreatedVar' , '' , 'preCreatedVarId' ) ;
51- this . workspace . createVariable (
52- 'preCreatedTypedVar' ,
53- 'type' ,
54- 'preCreatedTypedVarId' ,
55- ) ;
50+ this . workspace
51+ . getVariableMap ( )
52+ . createVariable ( 'preCreatedVar' , '' , 'preCreatedVarId' ) ;
53+ this . workspace
54+ . getVariableMap ( )
55+ . createVariable ( 'preCreatedTypedVar' , 'type' , 'preCreatedTypedVarId' ) ;
5656
5757 Blockly . defineBlocksWithJsonArray ( [
5858 {
@@ -869,7 +869,7 @@ suite('Procedures', function () {
869869 defBlock . compose ( containerBlock ) ;
870870
871871 assert . isNotNull (
872- this . workspace . getVariable ( 'param1' , '' ) ,
872+ this . workspace . getVariableMap ( ) . getVariable ( 'param1' , '' ) ,
873873 'Expected the old variable to continue to exist' ,
874874 ) ;
875875 } ) ;
@@ -890,8 +890,10 @@ suite('Procedures', function () {
890890 . connection . connect ( paramBlock . previousConnection ) ;
891891 defBlock . compose ( containerBlock ) ;
892892
893- const variable = this . workspace . getVariable ( 'param1' , '' ) ;
894- this . workspace . renameVariableById ( variable . getId ( ) , 'new name' ) ;
893+ const variable = this . workspace
894+ . getVariableMap ( )
895+ . getVariable ( 'param1' , '' ) ;
896+ this . workspace . getVariableMap ( ) . renameVariable ( variable , 'new name' ) ;
895897
896898 assert . isNotNull (
897899 defBlock . getField ( 'PARAMS' ) ,
@@ -922,8 +924,10 @@ suite('Procedures', function () {
922924 . connection . connect ( paramBlock . previousConnection ) ;
923925 defBlock . compose ( containerBlock ) ;
924926
925- const variable = this . workspace . getVariable ( 'param1' , '' ) ;
926- this . workspace . renameVariableById ( variable . getId ( ) , 'new name' ) ;
927+ const variable = this . workspace
928+ . getVariableMap ( )
929+ . getVariable ( 'param1' , '' ) ;
930+ this . workspace . getVariableMap ( ) . renameVariable ( variable , 'new name' ) ;
927931
928932 assert . equal (
929933 paramBlock . getFieldValue ( 'NAME' ) ,
@@ -950,8 +954,10 @@ suite('Procedures', function () {
950954 . connection . connect ( paramBlock . previousConnection ) ;
951955 defBlock . compose ( containerBlock ) ;
952956
953- const variable = this . workspace . getVariable ( 'param1' , '' ) ;
954- this . workspace . renameVariableById ( variable . getId ( ) , 'new name' ) ;
957+ const variable = this . workspace
958+ . getVariableMap ( )
959+ . getVariable ( 'param1' , '' ) ;
960+ this . workspace . getVariableMap ( ) . renameVariable ( variable , 'new name' ) ;
955961
956962 assert . isNotNull (
957963 callBlock . getInput ( 'ARG0' ) ,
@@ -981,8 +987,12 @@ suite('Procedures', function () {
981987 . connection . connect ( paramBlock . previousConnection ) ;
982988 defBlock . compose ( containerBlock ) ;
983989
984- const variable = this . workspace . getVariable ( 'param1' , '' ) ;
985- this . workspace . renameVariableById ( variable . getId ( ) , 'preCreatedVar' ) ;
990+ const variable = this . workspace
991+ . getVariableMap ( )
992+ . getVariable ( 'param1' , '' ) ;
993+ this . workspace
994+ . getVariableMap ( )
995+ . renameVariable ( variable , 'preCreatedVar' ) ;
986996
987997 assert . isNotNull (
988998 defBlock . getField ( 'PARAMS' ) ,
@@ -1013,8 +1023,12 @@ suite('Procedures', function () {
10131023 . connection . connect ( paramBlock . previousConnection ) ;
10141024 defBlock . compose ( containerBlock ) ;
10151025
1016- const variable = this . workspace . getVariable ( 'param1' , '' ) ;
1017- this . workspace . renameVariableById ( variable . getId ( ) , 'preCreatedVar' ) ;
1026+ const variable = this . workspace
1027+ . getVariableMap ( )
1028+ . getVariable ( 'param1' , '' ) ;
1029+ this . workspace
1030+ . getVariableMap ( )
1031+ . renameVariable ( variable , 'preCreatedVar' ) ;
10181032
10191033 assert . equal (
10201034 paramBlock . getFieldValue ( 'NAME' ) ,
@@ -1041,8 +1055,12 @@ suite('Procedures', function () {
10411055 . connection . connect ( paramBlock . previousConnection ) ;
10421056 defBlock . compose ( containerBlock ) ;
10431057
1044- const variable = this . workspace . getVariable ( 'param1' , '' ) ;
1045- this . workspace . renameVariableById ( variable . getId ( ) , 'preCreatedVar' ) ;
1058+ const variable = this . workspace
1059+ . getVariableMap ( )
1060+ . getVariable ( 'param1' , '' ) ;
1061+ this . workspace
1062+ . getVariableMap ( )
1063+ . renameVariable ( variable , 'preCreatedVar' ) ;
10461064
10471065 assert . isNotNull (
10481066 callBlock . getInput ( 'ARG0' ) ,
0 commit comments