mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Reduce unneeded parentheses in JS and Python.
This commit is contained in:
@@ -133,11 +133,7 @@ Blockly.PHP['lists_getIndex'] = function(block) {
|
||||
var at = Blockly.PHP.valueToCode(block, 'AT',
|
||||
Blockly.PHP.ORDER_UNARY_NEGATION) || '1';
|
||||
if (mode == 'GET') {
|
||||
// Special case to avoid wrapping function calls in unneeded parenthesis.
|
||||
// func()[0] is prefered over (func())[0]
|
||||
var valueBlock = this.getInputTargetBlock('VALUE');
|
||||
var order = (valueBlock && valueBlock.type == 'procedures_callreturn') ?
|
||||
Blockly.PHP.ORDER_NONE : Blockly.PHP.ORDER_FUNCTION_CALL;
|
||||
var order = Blockly.PHP.ORDER_FUNCTION_CALL;
|
||||
} else {
|
||||
// List will be an argument in a function call.
|
||||
var order = Blockly.PHP.ORDER_COMMA;
|
||||
|
||||
Reference in New Issue
Block a user