Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Normalize ++x to x++. #5660

Merged
merged 1 commit into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,7 @@ Block.prototype.jsonInit = function(json) {

const extensionNames = json['extensions'];
if (Array.isArray(extensionNames)) {
for (let j = 0; j < extensionNames.length; ++j) {
for (let j = 0; j < extensionNames.length; j++) {
Extensions.apply(extensionNames[j], this, false);
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ const checkDropdownOptionsInTable = function(block, dropdownName, lookupTable) {
const dropdown = block.getField(dropdownName);
if (!dropdown.isOptionListDynamic()) {
const options = dropdown.getOptions();
for (let i = 0; i < options.length; ++i) {
for (let i = 0; i < options.length; i++) {
const optionKey = options[i][1]; // label, then value
if (lookupTable[optionKey] === null) {
console.warn(
Expand Down
2 changes: 1 addition & 1 deletion core/field_dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ const validateOptions = function(options) {
throw TypeError('FieldDropdown options must not be an empty array.');
}
let foundError = false;
for (let i = 0; i < options.length; ++i) {
for (let i = 0; i < options.length; i++) {
const tuple = options[i];
if (!Array.isArray(tuple)) {
foundError = true;
Expand Down
2 changes: 1 addition & 1 deletion core/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Input.prototype.insertFieldAt = function(index, field, opt_name) {
}
// Add the field to the field row.
this.fieldRow.splice(index, 0, field);
++index;
index++;
if (field.suffixField) {
// Add any suffix.
index = this.insertFieldAt(index, field.suffixField);
Expand Down
2 changes: 1 addition & 1 deletion core/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ const tokenizeInterpolation_ = function(message, parseInterpolationTokens) {
// Merge adjacent text tokens into a single string.
const mergedTokens = [];
buffer.length = 0;
for (let i = 0; i < tokens.length; ++i) {
for (let i = 0; i < tokens.length; i++) {
if (typeof tokens[i] === 'string') {
buffer.push(tokens[i]);
} else {
Expand Down
2 changes: 1 addition & 1 deletion generators/dart/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Blockly.Dart['controls_if'] = function(block) {
}
code += (n > 0 ? 'else ' : '') +
'if (' + conditionCode + ') {\n' + branchCode + '}';
++n;
n++;
} while (block.getInput('IF' + n));

if (block.getInput('ELSE') || Blockly.Dart.STATEMENT_SUFFIX) {
Expand Down
2 changes: 1 addition & 1 deletion generators/javascript/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Blockly.JavaScript['controls_if'] = function(block) {
}
code += (n > 0 ? ' else ' : '') +
'if (' + conditionCode + ') {\n' + branchCode + '}';
++n;
n++;
} while (block.getInput('IF' + n));

if (block.getInput('ELSE') || Blockly.JavaScript.STATEMENT_SUFFIX) {
Expand Down
2 changes: 1 addition & 1 deletion generators/lua/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Blockly.Lua['controls_if'] = function(block) {
}
code += (n > 0 ? 'else' : '') +
'if ' + conditionCode + ' then\n' + branchCode;
++n;
n++;
} while (block.getInput('IF' + n));

if (block.getInput('ELSE') || Blockly.Lua.STATEMENT_SUFFIX) {
Expand Down
2 changes: 1 addition & 1 deletion generators/php/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Blockly.PHP['controls_if'] = function(block) {
}
code += (n > 0 ? ' else ' : '') +
'if (' + conditionCode + ') {\n' + branchCode + '}';
++n;
n++;
} while (block.getInput('IF' + n));

if (block.getInput('ELSE') || Blockly.PHP.STATEMENT_SUFFIX) {
Expand Down
2 changes: 1 addition & 1 deletion generators/python/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Blockly.Python['controls_if'] = function(block) {
Blockly.Python.INDENT) + branchCode;
}
code += (n === 0 ? 'if ' : 'elif ') + conditionCode + ':\n' + branchCode;
++n;
n++;
} while (block.getInput('IF' + n));

if (block.getInput('ELSE') || Blockly.Python.STATEMENT_SUFFIX) {
Expand Down