mirror of
https://github.com/google/blockly.git
synced 2026-01-04 23:50:12 +01:00
Block generator warnings (#3353)
This commit is contained in:
@@ -252,7 +252,7 @@ Blockly.JavaScript['lists_setIndex'] = function(block) {
|
||||
* @param {string} listName Name of the list, used to calculate length.
|
||||
* @param {string} where The method of indexing, selected by dropdown in Blockly
|
||||
* @param {string=} opt_at The optional offset when indexing from start/end.
|
||||
* @return {string} Index expression.
|
||||
* @return {string|undefined} Index expression.
|
||||
* @private
|
||||
*/
|
||||
Blockly.JavaScript.lists.getIndex_ = function(listName, where, opt_at) {
|
||||
|
||||
@@ -43,7 +43,7 @@ Blockly.JavaScript['controls_repeat_ext'] = function(block) {
|
||||
'count', Blockly.VARIABLE_CATEGORY_NAME);
|
||||
var endVar = repeats;
|
||||
if (!repeats.match(/^\w+$/) && !Blockly.isNumber(repeats)) {
|
||||
var endVar = Blockly.JavaScript.variableDB_.getDistinctName(
|
||||
endVar = Blockly.JavaScript.variableDB_.getDistinctName(
|
||||
'repeat_end', Blockly.VARIABLE_CATEGORY_NAME);
|
||||
code += 'var ' + endVar + ' = ' + repeats + ';\n';
|
||||
}
|
||||
@@ -109,7 +109,7 @@ Blockly.JavaScript['controls_for'] = function(block) {
|
||||
}
|
||||
var endVar = argument1;
|
||||
if (!argument1.match(/^\w+$/) && !Blockly.isNumber(argument1)) {
|
||||
var endVar = Blockly.JavaScript.variableDB_.getDistinctName(
|
||||
endVar = Blockly.JavaScript.variableDB_.getDistinctName(
|
||||
variable0 + '_end', Blockly.VARIABLE_CATEGORY_NAME);
|
||||
code += 'var ' + endVar + ' = ' + argument1 + ';\n';
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ Blockly.JavaScript['text_charAt'] = function(block) {
|
||||
* @param {string} stringName Name of the string, used to calculate length.
|
||||
* @param {string} where The method of indexing, selected by dropdown in Blockly
|
||||
* @param {string=} opt_at The optional offset when indexing from start/end.
|
||||
* @return {string} Index expression.
|
||||
* @return {string|undefined} Index expression.
|
||||
* @private
|
||||
*/
|
||||
Blockly.JavaScript.text.getIndex_ = function(stringName, where, opt_at) {
|
||||
|
||||
Reference in New Issue
Block a user