mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-07-17 09:22:43 -04:00
Pulling in the latest changes from google/blockly/variables_by_id branch,
starting with commit 6218750 (December 19, 2017) through commit 80b397f (January 10, 2018).
This commit is contained in:
parent
ddf61c146b
commit
855ec2665a
15 changed files with 507 additions and 232 deletions
generators
|
@ -149,12 +149,23 @@ Blockly.PHP.init = function(workspace) {
|
|||
Blockly.PHP.variableDB_.reset();
|
||||
}
|
||||
|
||||
Blockly.PHP.variableDB_.setVariableMap(workspace.getVariableMap());
|
||||
|
||||
var defvars = [];
|
||||
var variables = Blockly.Variables.allVariables(workspace);
|
||||
for (var i = 0; i < variables.length; i++) {
|
||||
defvars[i] = Blockly.PHP.variableDB_.getName(variables[i],
|
||||
var variables = workspace.getAllVariables();
|
||||
for (var i = 0, variable; variable = variables[i]; i++) {
|
||||
defvars[i] = Blockly.PHP.variableDB_.getName(variable.getId(),
|
||||
Blockly.Variables.NAME_TYPE) + ';';
|
||||
}
|
||||
|
||||
// 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(Blockly.PHP.variableDB_.getName(devVarList[i],
|
||||
Blockly.Names.DEVELOPER_VARIABLE_TYPE) + ';');
|
||||
}
|
||||
|
||||
// Declare all of the variables.
|
||||
Blockly.PHP.definitions_['variables'] = defvars.join('\n');
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue