mirror of
https://github.com/google/blockly.git
synced 2026-01-06 16:40:07 +01:00
Headless workspaces and blocks.
This commit is contained in:
@@ -73,8 +73,10 @@ Blockly.Dart.ORDER_NONE = 99; // (...)
|
||||
|
||||
/**
|
||||
* Initialise the database of variable names.
|
||||
* @param {Blockly.Workspace=} opt_workspace Workspace to generate code from.
|
||||
* Defaults to main workspace.
|
||||
*/
|
||||
Blockly.Dart.init = function() {
|
||||
Blockly.Dart.init = function(opt_workspace) {
|
||||
// Create a dictionary of definitions to be printed before the code.
|
||||
Blockly.Dart.definitions_ = Object.create(null);
|
||||
// Create a dictionary mapping desired function names in definitions_
|
||||
@@ -89,7 +91,7 @@ Blockly.Dart.init = function() {
|
||||
}
|
||||
|
||||
var defvars = [];
|
||||
var variables = Blockly.Variables.allVariables();
|
||||
var variables = Blockly.Variables.allVariables(opt_workspace);
|
||||
for (var x = 0; x < variables.length; x++) {
|
||||
defvars[x] = 'var ' +
|
||||
Blockly.Dart.variableDB_.getName(variables[x],
|
||||
|
||||
Reference in New Issue
Block a user