Change setLocation to setCurNode (#3051)

* Change setLocation to setCurNode
This commit is contained in:
alschmiedt
2019-09-19 15:15:14 -07:00
committed by GitHub
parent a1e3973499
commit 6516363469
11 changed files with 369 additions and 368 deletions

View File

@@ -75,14 +75,14 @@ suite('Cursor', function() {
test('Next - From a block skip over next connection', function() {
var blockNode = Blockly.ASTNode.createBlockNode(this.blocks.A);
this.cursor.setLocation(blockNode);
this.cursor.setCurNode(blockNode);
this.cursor.next();
var curNode = this.cursor.getCurNode();
assertEquals(curNode.getLocation(), this.blocks.B.previousConnection);
});
test('Next - From last block in a stack go to next connection', function() {
var blockNode = Blockly.ASTNode.createBlockNode(this.blocks.B);
this.cursor.setLocation(blockNode);
this.cursor.setCurNode(blockNode);
this.cursor.next();
var curNode = this.cursor.getCurNode();
assertEquals(curNode.getLocation(), this.blocks.B.nextConnection);
@@ -90,7 +90,7 @@ suite('Cursor', function() {
test('In - From input skip over output connection', function() {
var inputNode = Blockly.ASTNode.createInputNode(this.blocks.A.inputList[0]);
this.cursor.setLocation(inputNode);
this.cursor.setCurNode(inputNode);
this.cursor.in();
var curNode = this.cursor.getCurNode();
assertEquals(curNode.getLocation(), this.blocks.E);
@@ -99,7 +99,7 @@ suite('Cursor', function() {
test('Prev - From previous connection skip over next connection', function() {
var prevConnection = this.blocks.B.previousConnection;
var prevConnectionNode = Blockly.ASTNode.createConnectionNode(prevConnection);
this.cursor.setLocation(prevConnectionNode);
this.cursor.setCurNode(prevConnectionNode);
this.cursor.prev();
var curNode = this.cursor.getCurNode();
assertEquals(curNode.getLocation(), this.blocks.A.previousConnection);