mirror of
https://github.com/google/blockly.git
synced 2026-01-09 10:00:09 +01:00
feat: add getVariableName and getProcedureName to CodeGenerator (#7445)
* feat: add getVariableName and getProcedureName to CodeGenerator * feat: make nameDB_ public * feat: update block code generators to use new APIs * chore: fix build * chore: remove unused imports
This commit is contained in:
committed by
GitHub
parent
b0a7c004a9
commit
68261e5dd9
@@ -65,8 +65,8 @@ export function controls_whileUntil(block, generator) {
|
||||
export function controls_for(block, generator) {
|
||||
// For loop.
|
||||
const variable0 =
|
||||
generator.nameDB_.getName(
|
||||
block.getFieldValue('VAR'), NameType.VARIABLE);
|
||||
generator.getVariableName(
|
||||
block.getFieldValue('VAR'));
|
||||
const argument0 =
|
||||
generator.valueToCode(block, 'FROM', Order.ASSIGNMENT) || '0';
|
||||
const argument1 =
|
||||
@@ -128,8 +128,7 @@ export function controls_for(block, generator) {
|
||||
export function controls_forEach(block, generator) {
|
||||
// For each loop.
|
||||
const variable0 =
|
||||
generator.nameDB_.getName(
|
||||
block.getFieldValue('VAR'), NameType.VARIABLE);
|
||||
generator.getVariableName(block.getFieldValue('VAR'));
|
||||
const argument0 =
|
||||
generator.valueToCode(block, 'LIST', Order.ASSIGNMENT) ||
|
||||
'[]';
|
||||
|
||||
Reference in New Issue
Block a user