mirror of
https://github.com/google/blockly.git
synced 2026-01-06 16:40:07 +01:00
Remove useless variable declarations in PHP. (#4849)
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,32 +1,3 @@
|
||||
$unittestResults;
|
||||
$test_name;
|
||||
$naked;
|
||||
$proc_x;
|
||||
$proc_y;
|
||||
$func_x;
|
||||
$func_y;
|
||||
$func_a;
|
||||
$n;
|
||||
$ok;
|
||||
$log;
|
||||
$count;
|
||||
$varToChange;
|
||||
$rand;
|
||||
$item;
|
||||
$text;
|
||||
$number_of_calls;
|
||||
$list2;
|
||||
$proc_z;
|
||||
$func_z;
|
||||
$x;
|
||||
$proc_w;
|
||||
$func_c;
|
||||
$if2;
|
||||
$i;
|
||||
$loglist;
|
||||
$changing_list;
|
||||
$list_copy;
|
||||
|
||||
function unittest_report() {
|
||||
global $unittestResults;
|
||||
// Create test report.
|
||||
|
||||
Reference in New Issue
Block a user