diff --git a/core/keyboard_nav/ast_node.js b/core/keyboard_nav/ast_node.js index 9f1ed6e9d..f4328a0ae 100644 --- a/core/keyboard_nav/ast_node.js +++ b/core/keyboard_nav/ast_node.js @@ -242,33 +242,6 @@ Blockly.ASTNode.prototype.isConnection = function() { return this.isConnection_; }; -/** - * Get either the previous editable field, or get the first editable field for - * the given input. - * @param {!(Blockly.Field|Blockly.Connection)} location The current location of - * the cursor, which must be a field or connection. - * @param {!Blockly.Input} parentInput The parentInput of the field. - * @param {boolean=} opt_last If true find the last editable field otherwise get - * the previous field. - * @return {Blockly.ASTNode} The AST node holding the previous or last field or - * null if no previous field exists. - * @private - */ -Blockly.ASTNode.prototype.findPreviousEditableField_ = function(location, - parentInput, opt_last) { - var fieldRow = parentInput.fieldRow; - var fieldIdx = fieldRow.indexOf(location); - var previousField = null; - var startIdx = (opt_last ? fieldRow.length : fieldIdx) - 1; - for (var i = startIdx, field; field = fieldRow[i]; i--) { - if (field.EDITABLE) { - previousField = field; - return Blockly.ASTNode.createFieldNode(previousField); - } - } - return null; -}; - /** * Given an input find the next editable field or an input with a non null * connection in the same block. The current location must be an input diff --git a/tests/mocha/astnode_test.js b/tests/mocha/astnode_test.js index ae3f65a43..b172de82f 100644 --- a/tests/mocha/astnode_test.js +++ b/tests/mocha/astnode_test.js @@ -110,23 +110,6 @@ suite('ASTNode', function() { }); suite('HelperFunctions', function() { - test('findPreviousEditableField_', function() { - var input = this.blocks.statementInput1.inputList[0]; - var field = input.fieldRow[1]; - var prevField = input.fieldRow[0]; - var node = Blockly.ASTNode.createFieldNode(prevField); - var editableField = node.findPreviousEditableField_(field, input); - assertEquals(editableField.getLocation(), prevField); - }); - - test('findPreviousEditableFieldLast_', function() { - var input = this.blocks.statementInput1.inputList[0]; - var field = input.fieldRow[0]; - var node = Blockly.ASTNode.createFieldNode(field); - var editableField = node.findPreviousEditableField_(field, input, true); - assertEquals(editableField.getLocation(), input.fieldRow[1]); - }); - test('findNextForInput_', function() { var input = this.blocks.statementInput1.inputList[0]; var input2 = this.blocks.statementInput1.inputList[1];