chore: fix missing requires in generators (#5744)

* chore: fix some missing requires in generators

* chore: fix missing requires in dart block generators

* chore: replace Blockly.isNumber with Blockly.utils.string.isNumber in generators

* chore: fix more missing requires in block generators
This commit is contained in:
Rachel Fenichel
2021-11-30 08:51:21 -08:00
committed by GitHub
parent 1a992386ae
commit 4db047ff32
18 changed files with 238 additions and 210 deletions

View File

@@ -13,9 +13,12 @@
goog.provide('Blockly.Dart');
goog.require('Blockly.Generator');
goog.require('Blockly.Names');
goog.require('Blockly.Variables');
goog.require('Blockly.inputTypes');
goog.require('Blockly.utils.string');
goog.requireType('Blockly.Block');
goog.requireType('Blockly.Workspace');
/**
* Dart code generator.
@@ -268,7 +271,7 @@ Blockly.Dart.getAdjusted = function(block, atId, opt_delta, opt_negate,
/** @type {string|number} */
let at = this.valueToCode(block, atId, outerOrder) || defaultAtIndex;
if (Blockly.isNumber(at)) {
if (Blockly.utils.string.isNumber(at)) {
// If the index is a naked number, adjust it right now.
at = parseInt(at, 10) + delta;
if (opt_negate) {