Resolve warnings in generator code (#3350)

This commit is contained in:
Sam El-Husseini
2019-10-28 09:35:40 -07:00
committed by GitHub
parent fa5f256a3f
commit 64c52efb5b
34 changed files with 81 additions and 80 deletions

View File

@@ -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') {