mirror of
https://github.com/google/blockly.git
synced 2026-02-14 11:30:13 +01:00
refactor!: Deprecate Block.getVars() (#9574)
* refactor!: Deprecate `Block.getVars()` * fix: Fix import path * fix: Simplify test assertions
This commit is contained in:
@@ -58,9 +58,9 @@ export function procedures_defreturn(
|
||||
returnValue = generator.INDENT + 'return ' + returnValue + ';\n';
|
||||
}
|
||||
const args = [];
|
||||
const variables = block.getVars();
|
||||
const variables = block.getVarModels();
|
||||
for (let i = 0; i < variables.length; i++) {
|
||||
args[i] = generator.getVariableName(variables[i]);
|
||||
args[i] = generator.getVariableName(variables[i].getId());
|
||||
}
|
||||
let code =
|
||||
'function ' +
|
||||
@@ -93,7 +93,7 @@ export function procedures_callreturn(
|
||||
// Call a procedure with a return value.
|
||||
const funcName = generator.getProcedureName(block.getFieldValue('NAME'));
|
||||
const args = [];
|
||||
const variables = block.getVars();
|
||||
const variables = block.getVarModels();
|
||||
for (let i = 0; i < variables.length; i++) {
|
||||
args[i] = generator.valueToCode(block, 'ARG' + i, Order.NONE) || 'null';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user