From 39b7f95827bf16be288732febb16100066df9d9d Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Wed, 12 Dec 2018 06:50:35 -0800 Subject: [PATCH] Renamed var block to node in cleanBlockXML_. --- core/trashcan.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/core/trashcan.js b/core/trashcan.js index 812ed4fae..44d0dafa4 100644 --- a/core/trashcan.js +++ b/core/trashcan.js @@ -479,34 +479,34 @@ Blockly.Trashcan.prototype.onDelete_ = function() { */ Blockly.Trashcan.prototype.cleanBlockXML_ = function(xml) { var xmlBlock = xml.cloneNode(true); - var block = xmlBlock; - while (block) { + var node = xmlBlock; + while (node) { // Things like text inside tags are still treated as nodes, but they // don't have attributes (or the removeAttribute function) so we can // skip removing attributes from them. - if (block.removeAttribute) { - block.removeAttribute('x'); - block.removeAttribute('y'); - block.removeAttribute('id'); + if (node.removeAttribute) { + node.removeAttribute('x'); + node.removeAttribute('y'); + node.removeAttribute('id'); } - // Try to traverse down the tree - var nextBlock = block.firstChild || block.nextSibling; - // If we can't go down, try to traverse back up the tree. - if (!nextBlock) { - nextBlock = block.parentNode; - while (nextBlock) { + // Try to go down the tree + var nextNode = node.firstChild || node.nextSibling; + // If we can't go down, try to go back up the tree. + if (!nextNode) { + nextNode = node.parentNode; + while (nextNode) { // We are valid again! - if (nextBlock.nextSibling) { - nextBlock = nextBlock.nextSibling; + if (nextNode.nextSibling) { + nextNode = nextNode.nextSibling; break; } // Try going up again. If parentNode is null that means we have // reached the top, and we will break out of both loops. - nextBlock = nextBlock.parentNode; + nextNode = nextNode.parentNode; } } - block = nextBlock; + node = nextNode; } return xmlBlock; };