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,6 +13,7 @@
goog.provide('Blockly.Python.texts');
goog.require('Blockly.Python');
goog.require('Blockly.utils.string');
Blockly.Python['text'] = function(block) {
@@ -200,7 +201,7 @@ Blockly.Python['text_getSubstring'] = function(block) {
at2 = Blockly.Python.getAdjustedInt(block, 'AT2', 0, true);
// Ensure that if the result calculated is 0 that sub-sequence will
// include all elements as expected.
if (!Blockly.isNumber(String(at2))) {
if (!Blockly.utils.string.isNumber(String(at2))) {
Blockly.Python.definitions_['import_sys'] = 'import sys';
at2 += ' or sys.maxsize';
} else if (at2 === 0) {