mirror of
https://github.com/google/blockly.git
synced 2025-12-16 06:10:12 +01:00
refactor: Use IVariableModel instead of VariableModel. (#8400)
* refactor: Use IVariableModel methods instead of directly accessing properties. * refactor: replace references to VariableModel with IVariableModel.
This commit is contained in:
@@ -25,7 +25,7 @@ export function procedures_defreturn(block: Block, generator: PhpGenerator) {
|
||||
const workspace = block.workspace;
|
||||
const usedVariables = Variables.allUsedVarModels(workspace) || [];
|
||||
for (const variable of usedVariables) {
|
||||
const varName = variable.name;
|
||||
const varName = variable.getName();
|
||||
// getVars returns parameter names, not ids, for procedure blocks
|
||||
if (!block.getVars().includes(varName)) {
|
||||
globals.push(generator.getVariableName(varName));
|
||||
|
||||
@@ -25,7 +25,7 @@ export function procedures_defreturn(block: Block, generator: PythonGenerator) {
|
||||
const workspace = block.workspace;
|
||||
const usedVariables = Variables.allUsedVarModels(workspace) || [];
|
||||
for (const variable of usedVariables) {
|
||||
const varName = variable.name;
|
||||
const varName = variable.getName();
|
||||
// getVars returns parameter names, not ids, for procedure blocks
|
||||
if (!block.getVars().includes(varName)) {
|
||||
globals.push(generator.getVariableName(varName));
|
||||
|
||||
Reference in New Issue
Block a user