mirror of
https://github.com/google/blockly.git
synced 2026-01-06 08:30:13 +01:00
chore: Use .includes and .startsWith, not .indexOf (#7936)
Easier to read than the diverse collection of `=== 0` and `!== -1` and `> -1` tests.
This commit is contained in:
@@ -27,7 +27,7 @@ export function procedures_defreturn(block: Block, generator: PythonGenerator) {
|
||||
for (const variable of usedVariables) {
|
||||
const varName = variable.name;
|
||||
// getVars returns parameter names, not ids, for procedure blocks
|
||||
if (block.getVars().indexOf(varName) === -1) {
|
||||
if (!block.getVars().includes(varName)) {
|
||||
globals.push(generator.getVariableName(varName));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user