mirror of
https://github.com/google/blockly.git
synced 2026-01-06 08:30:13 +01:00
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:
@@ -24,6 +24,7 @@
|
||||
goog.provide('Blockly.PHP.lists');
|
||||
|
||||
goog.require('Blockly.PHP');
|
||||
goog.require('Blockly.utils.string');
|
||||
|
||||
|
||||
Blockly.PHP['lists_create_empty'] = function(block) {
|
||||
@@ -387,7 +388,7 @@ Blockly.PHP['lists_getSublist'] = function(block) {
|
||||
at2 = Blockly.PHP.getAdjusted(block, 'AT2', 0, false,
|
||||
Blockly.PHP.ORDER_SUBTRACTION);
|
||||
length = at2 + ' - ';
|
||||
if (Blockly.isNumber(String(at1)) || String(at1).match(/^\(.+\)$/)) {
|
||||
if (Blockly.utils.string.isNumber(String(at1)) || String(at1).match(/^\(.+\)$/)) {
|
||||
length += at1;
|
||||
} else {
|
||||
length += '(' + at1 + ')';
|
||||
@@ -398,7 +399,7 @@ Blockly.PHP['lists_getSublist'] = function(block) {
|
||||
at2 = Blockly.PHP.getAdjusted(block, 'AT2', 0, false,
|
||||
Blockly.PHP.ORDER_SUBTRACTION);
|
||||
length = 'count(' + list + ') - ' + at2 + ' - ';
|
||||
if (Blockly.isNumber(String(at1)) || String(at1).match(/^\(.+\)$/)) {
|
||||
if (Blockly.utils.string.isNumber(String(at1)) || String(at1).match(/^\(.+\)$/)) {
|
||||
length += at1;
|
||||
} else {
|
||||
length += '(' + at1 + ')';
|
||||
@@ -406,7 +407,7 @@ Blockly.PHP['lists_getSublist'] = function(block) {
|
||||
break;
|
||||
case 'LAST':
|
||||
length = 'count(' + list + ') - ';
|
||||
if (Blockly.isNumber(String(at1)) || String(at1).match(/^\(.+\)$/)) {
|
||||
if (Blockly.utils.string.isNumber(String(at1)) || String(at1).match(/^\(.+\)$/)) {
|
||||
length += at1;
|
||||
} else {
|
||||
length += '(' + at1 + ')';
|
||||
|
||||
Reference in New Issue
Block a user