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

@@ -269,7 +269,7 @@ Blockly.PHP['lists_setIndex'] = function(block) {
return '';
}
var listVar = Blockly.PHP.variableDB_.getDistinctName(
'tmp_list', Blockly.Variables.NAME_TYPE);
'tmp_list', Blockly.VARIABLE_CATEGORY_NAME);
var code = listVar + ' = &' + list + ';\n';
list = listVar;
return code;
@@ -340,7 +340,7 @@ Blockly.PHP['lists_setIndex'] = function(block) {
Blockly.PHP.ORDER_REFERENCE) || 'array()';
var code = cacheList();
var xVar = Blockly.PHP.variableDB_.getDistinctName(
'tmp_x', Blockly.Variables.NAME_TYPE);
'tmp_x', Blockly.VARIABLE_CATEGORY_NAME);
code += xVar + ' = rand(0, count(' + list + ')-1);\n';
if (mode == 'SET') {
code += list + '[' + xVar + '] = ' + value + ';\n';