mirror of
https://github.com/google/blockly.git
synced 2026-01-06 08:30:13 +01:00
Resolve warnings in generator code (#3350)
This commit is contained in:
@@ -186,7 +186,7 @@ Blockly.JavaScript['lists_setIndex'] = function(block) {
|
||||
return '';
|
||||
}
|
||||
var listVar = Blockly.JavaScript.variableDB_.getDistinctName(
|
||||
'tmpList', Blockly.Variables.NAME_TYPE);
|
||||
'tmpList', Blockly.VARIABLE_CATEGORY_NAME);
|
||||
var code = 'var ' + listVar + ' = ' + list + ';\n';
|
||||
list = listVar;
|
||||
return code;
|
||||
@@ -232,7 +232,7 @@ Blockly.JavaScript['lists_setIndex'] = function(block) {
|
||||
case ('RANDOM'):
|
||||
var code = cacheList();
|
||||
var xVar = Blockly.JavaScript.variableDB_.getDistinctName(
|
||||
'tmpX', Blockly.Variables.NAME_TYPE);
|
||||
'tmpX', Blockly.VARIABLE_CATEGORY_NAME);
|
||||
code += 'var ' + xVar + ' = Math.floor(Math.random() * ' + list +
|
||||
'.length);\n';
|
||||
if (mode == 'SET') {
|
||||
|
||||
Reference in New Issue
Block a user