diff --git a/core/connection.js b/core/connection.js index ff16066df..1aa1446be 100644 --- a/core/connection.js +++ b/core/connection.js @@ -139,7 +139,7 @@ Blockly.Connection.prototype.connect_ = function(childConnection) { orphanBlock = null; } } else if ( - parentConnection.type == Blockly.connectionTypes.NEXT_STATEMENT) { + parentConnection.type == Blockly.connectionTypes.NEXT_STATEMENT) { // Statement connections. // Statement blocks may be inserted into the middle of a stack. // Split the stack. diff --git a/core/events/block_events.js b/core/events/block_events.js index 52fc5d53d..32b9be618 100644 --- a/core/events/block_events.js +++ b/core/events/block_events.js @@ -546,13 +546,13 @@ Blockly.Events.Move.prototype.run = function(forward) { } else { var blockConnection = block.outputConnection || block.previousConnection; var parentConnection; + var connectionType = blockConnection.type; if (inputName) { var input = parentBlock.getInput(inputName); if (input) { parentConnection = input.connection; } - } else if ( - blockConnection.type == Blockly.connectionTypes.PREVIOUS_STATEMENT) { + } else if (connectionType == Blockly.connectionTypes.PREVIOUS_STATEMENT) { parentConnection = parentBlock.nextConnection; } if (parentConnection) { diff --git a/core/insertion_marker_manager.js b/core/insertion_marker_manager.js index 76bd389a6..656412750 100644 --- a/core/insertion_marker_manager.js +++ b/core/insertion_marker_manager.js @@ -628,8 +628,7 @@ Blockly.InsertionMarkerManager.prototype.hideInsertionMarker_ = function() { imConn.targetBlock().unplug(false); } // Inside of a C-block, first statement connection. - else if ( - imConn.type == Blockly.connectionTypes.NEXT_STATEMENT && + else if (imConn.type == Blockly.connectionTypes.NEXT_STATEMENT && imConn != markerNext) { var innerConnection = imConn.targetConnection; innerConnection.getSourceBlock().unplug(false); diff --git a/core/keyboard_nav/ast_node.js b/core/keyboard_nav/ast_node.js index e2abf643c..e7d61750c 100644 --- a/core/keyboard_nav/ast_node.js +++ b/core/keyboard_nav/ast_node.js @@ -145,20 +145,20 @@ Blockly.ASTNode.createFieldNode = function(field) { * @return {Blockly.ASTNode} An AST node pointing to a connection. */ Blockly.ASTNode.createConnectionNode = function(connection) { + var type = connection.type; if (!connection) { return null; } - if (connection.type == Blockly.connectionTypes.INPUT_VALUE) { + if (type == Blockly.connectionTypes.INPUT_VALUE) { return Blockly.ASTNode.createInputNode(connection.getParentInput()); - } else if ( - connection.type == Blockly.connectionTypes.NEXT_STATEMENT && + } else if (type == Blockly.connectionTypes.NEXT_STATEMENT && connection.getParentInput()) { return Blockly.ASTNode.createInputNode(connection.getParentInput()); - } else if (connection.type == Blockly.connectionTypes.NEXT_STATEMENT) { + } else if (type == Blockly.connectionTypes.NEXT_STATEMENT) { return new Blockly.ASTNode(Blockly.ASTNode.types.NEXT, connection); - } else if (connection.type == Blockly.connectionTypes.OUTPUT_VALUE) { + } else if (type == Blockly.connectionTypes.OUTPUT_VALUE) { return new Blockly.ASTNode(Blockly.ASTNode.types.OUTPUT, connection); - } else if (connection.type == Blockly.connectionTypes.PREVIOUS_STATEMENT) { + } else if (type == Blockly.connectionTypes.PREVIOUS_STATEMENT) { return new Blockly.ASTNode(Blockly.ASTNode.types.PREVIOUS, connection); } return null; diff --git a/core/renderers/common/marker_svg.js b/core/renderers/common/marker_svg.js index 33bcf6a19..8195440c7 100644 --- a/core/renderers/common/marker_svg.js +++ b/core/renderers/common/marker_svg.js @@ -207,14 +207,14 @@ Blockly.blockRendering.MarkerSvg.prototype.draw = function(oldNode, curNode) { Blockly.blockRendering.MarkerSvg.prototype.showAtLocation_ = function(curNode) { var curNodeAsConnection = /** @type {!Blockly.Connection} */ (curNode.getLocation()); + var connectionType = curNodeAsConnection.type; if (curNode.getType() == Blockly.ASTNode.types.BLOCK) { this.showWithBlock_(curNode); } else if (curNode.getType() == Blockly.ASTNode.types.OUTPUT) { this.showWithOutput_(curNode); - } else if (curNodeAsConnection.type == Blockly.connectionTypes.INPUT_VALUE) { + } else if (connectionType == Blockly.connectionTypes.INPUT_VALUE) { this.showWithInput_(curNode); - } else if ( - curNodeAsConnection.type == Blockly.connectionTypes.NEXT_STATEMENT) { + } else if (connectionType == Blockly.connectionTypes.NEXT_STATEMENT) { this.showWithNext_(curNode); } else if (curNode.getType() == Blockly.ASTNode.types.PREVIOUS) { this.showWithPrevious_(curNode);