mirror of
https://github.com/google/blockly.git
synced 2026-01-10 10:27:08 +01:00
refactor: make VariableMap implement IVariableMap. (#8395)
* refactor: make VariableMap implement IVariableMap. * chore: remove unused arrayUtils import. * chore: fix comment on variable map backing store. * chore: Added JSDoc to new VariableMap methods. * chore: Improve test descriptions.
This commit is contained in:
@@ -610,7 +610,11 @@ function createVariable(
|
||||
// Create a potential variable if in the flyout.
|
||||
let variable = null;
|
||||
if (potentialVariableMap) {
|
||||
variable = potentialVariableMap.createVariable(opt_name, opt_type, id);
|
||||
variable = potentialVariableMap.createVariable(
|
||||
opt_name,
|
||||
opt_type,
|
||||
id ?? undefined,
|
||||
);
|
||||
} else {
|
||||
// In the main workspace, create a real variable.
|
||||
variable = workspace.createVariable(opt_name, opt_type, id);
|
||||
|
||||
Reference in New Issue
Block a user