Remove useless variable declarations in PHP. (#4849)

This commit is contained in:
Neil Fraser
2021-05-27 21:40:04 -07:00
committed by GitHub
parent e661c92a36
commit 37a1ee55b8
2 changed files with 0 additions and 46 deletions

View File

@@ -143,23 +143,6 @@ Blockly.PHP.init = function(workspace) {
this.nameDB_.populateVariables(workspace);
this.nameDB_.populateProcedures(workspace);
var defvars = [];
// Add developer variables (not created or named by the user).
var devVarList = Blockly.Variables.allDeveloperVariables(workspace);
for (var i = 0; i < devVarList.length; i++) {
defvars.push(this.nameDB_.getName(devVarList[i],
Blockly.Names.DEVELOPER_VARIABLE_TYPE) + ';');
}
// Add user variables, but only ones that are being used.
var variables = Blockly.Variables.allUsedVarModels(workspace);
for (var i = 0, variable; (variable = variables[i]); i++) {
defvars.push(this.nameDB_.getName(variable.getId(),
Blockly.VARIABLE_CATEGORY_NAME) + ';');
}
// Declare all of the variables.
this.definitions_['variables'] = defvars.join('\n');
this.isInitialized = true;
};