mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
Factor out procedure population from generators
Also fix bug in Lua generator where variables were not populated in the nameDB (only language with no variable initialization).
This commit is contained in:
@@ -101,14 +101,8 @@ Blockly.Lua.init = function(workspace) {
|
||||
this.nameDB_.reset();
|
||||
}
|
||||
this.nameDB_.setVariableMap(workspace.getVariableMap());
|
||||
|
||||
// Add user procedures.
|
||||
var procedures = Blockly.Procedures.allProcedures(workspace);
|
||||
// Flatten the return vs no-return procedure lists.
|
||||
procedures = procedures[0].concat(procedures[1]);
|
||||
for (var i = 0; i < procedures.length; i++) {
|
||||
this.nameDB_.getName(procedures[i][0], Blockly.PROCEDURE_CATEGORY_NAME);
|
||||
}
|
||||
this.nameDB_.populateVariables(workspace);
|
||||
this.nameDB_.populateProcedures(workspace);
|
||||
|
||||
this.isInitialized = true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user