Collapse the five 0/1-based index flags into one option.

This commit is contained in:
Neil Fraser
2016-10-06 17:54:43 -07:00
parent e6ec2d6fd9
commit 7928fac3ce
24 changed files with 60 additions and 74 deletions

View File

@@ -172,7 +172,7 @@ Blockly.PHP['unittest_adjustindex'] = function(block) {
var index = Blockly.PHP.valueToCode(block, 'INDEX',
Blockly.PHP.ORDER_ADDITION) || '0';
// Adjust index if using one-based indexing.
if (Blockly.PHP.ONE_BASED_INDEXING) {
if (block.workspace.options.oneBasedIndex) {
if (Blockly.isNumber(index)) {
// If the index is a naked number, adjust it right now.
return [parseFloat(index) + 1, Blockly.PHP.ORDER_ATOMIC];