diff --git a/core/block.js b/core/block.js index 0fb157886..d27f5256c 100644 --- a/core/block.js +++ b/core/block.js @@ -1949,9 +1949,8 @@ Blockly.Block.prototype.removeInput = function(name, opt_quiet) { } if (opt_quiet) { return false; - } else { - throw Error('Input not found: ' + name); } + throw Error('Input not found: ' + name); }; /** diff --git a/core/extensions.js b/core/extensions.js index cf459ead1..0a2c146ad 100644 --- a/core/extensions.js +++ b/core/extensions.js @@ -227,10 +227,9 @@ Blockly.Extensions.checkMutatorDialog_ = function(object, errorPrefix) { return true; } else if (!hasCompose && !hasDecompose) { return false; - } else { - throw Error(errorPrefix + - 'Must have both or neither of "compose" and "decompose"'); } + throw Error(errorPrefix + + 'Must have both or neither of "compose" and "decompose"'); }; /** diff --git a/core/generator.js b/core/generator.js index d92c237db..781cd7263 100644 --- a/core/generator.js +++ b/core/generator.js @@ -219,9 +219,8 @@ Blockly.Generator.prototype.blockToCode = function(block, opt_thisOnly) { } else if (code === null) { // Block has handled code generation itself. return ''; - } else { - throw SyntaxError('Invalid code generated: ' + code); } + throw SyntaxError('Invalid code generated: ' + code); }; /** diff --git a/core/input.js b/core/input.js index 38b67ba87..57189c278 100644 --- a/core/input.js +++ b/core/input.js @@ -168,9 +168,8 @@ Blockly.Input.prototype.removeField = function(name, opt_quiet) { } if (opt_quiet) { return false; - } else { - throw Error('Field "' + name + '" not found.'); } + throw Error('Field "' + name + '" not found.'); }; /** diff --git a/core/names.js b/core/names.js index 60a0cfbed..3abd27f9e 100644 --- a/core/names.js +++ b/core/names.js @@ -95,9 +95,8 @@ Blockly.Names.prototype.getNameForUserVariable_ = function(id) { var variable = this.variableMap_.getVariableById(id); if (variable) { return variable.name; - } else { - return null; } + return null; }; /** diff --git a/core/shortcut_registry.js b/core/shortcut_registry.js index 7ecc00d24..14684e1b8 100644 --- a/core/shortcut_registry.js +++ b/core/shortcut_registry.js @@ -165,11 +165,10 @@ Blockly.ShortcutRegistry.prototype.removeKeyMapping = function( delete this.keyMap_[keyCode]; } return true; - } else if (!opt_quiet) { - console.warn( - 'No keyboard shortcut with name "' + shortcutName + + } + if (!opt_quiet) { + console.warn('No keyboard shortcut with name "' + shortcutName + '" registered with key code "' + keyCode + '"'); - return false; } return false; }; diff --git a/generators/php/procedures.js b/generators/php/procedures.js index 1b361ea9f..c5828d8e5 100644 --- a/generators/php/procedures.js +++ b/generators/php/procedures.js @@ -23,7 +23,7 @@ Blockly.PHP['procedures_defreturn'] = function(block) { var workspace = block.workspace; var variables = Blockly.Variables.allUsedVarModels(workspace) || []; for (var i = 0, variable; variable = variables[i]; i++) { - varName = variable.name; + var varName = variable.name; if (block.getVars().indexOf(varName) == -1) { globals.push(Blockly.PHP.nameDB_.getName(varName, Blockly.VARIABLE_CATEGORY_NAME));