diff --git a/core/block_render_svg.js b/core/block_render_svg.js index 0b8998104..d8753a18f 100644 --- a/core/block_render_svg.js +++ b/core/block_render_svg.js @@ -907,7 +907,7 @@ Blockly.BlockSvg.prototype.renderInlineRow_ = function(pathObject, row, cursor, var steps = pathObject.steps; var highlightSteps = pathObject.highlightSteps; - for (var x = 0, input; input = row[x]; x++) { + for (var i = 0, input; input = row[i]; i++) { var fieldX = cursor.x; var fieldY = cursor.y; if (row.thicker) { diff --git a/core/flyout_base.js b/core/flyout_base.js index 61ffed7cb..b7897e7b1 100644 --- a/core/flyout_base.js +++ b/core/flyout_base.js @@ -404,7 +404,7 @@ Blockly.Flyout.prototype.hide = function() { } this.setVisible(false); // Delete all the event listeners. - for (var x = 0, listen; listen = this.listeners_[x]; x++) { + for (var i = 0, listen; listen = this.listeners_[i]; i++) { Blockly.unbindEvent_(listen); } this.listeners_.length = 0; diff --git a/core/generator.js b/core/generator.js index fc7471b7d..13cfc3358 100644 --- a/core/generator.js +++ b/core/generator.js @@ -96,7 +96,7 @@ Blockly.Generator.prototype.workspaceToCode = function(workspace) { var code = []; this.init(workspace); var blocks = workspace.getTopBlocks(true); - for (var x = 0, block; block = blocks[x]; x++) { + for (var i = 0, block; block = blocks[i]; i++) { var line = this.blockToCode(block); if (Array.isArray(line)) { // Value blocks return tuples of code and operator order. diff --git a/core/xml.js b/core/xml.js index 158bd8e0c..d953c87e3 100644 --- a/core/xml.js +++ b/core/xml.js @@ -250,8 +250,8 @@ Blockly.Xml.cloneShadow_ = function(shadow) { while (node && !node.nextSibling) { textNode = node; node = node.parentNode; - if (textNode.nodeType == 3 && textNode.data.trim() == '' && - node.firstChild != textNode) { + if (textNode.nodeType == Element.TEXT_NODE && + textNode.data.trim() == '' && node.firstChild != textNode) { // Prune whitespace after a tag. Blockly.utils.removeNode(textNode); } @@ -259,7 +259,8 @@ Blockly.Xml.cloneShadow_ = function(shadow) { if (node) { textNode = node; node = node.nextSibling; - if (textNode.nodeType == 3 && textNode.data.trim() == '') { + if (textNode.nodeType == Element.TEXT_NODE && + textNode.data.trim() == '') { // Prune whitespace before a tag. Blockly.utils.removeNode(textNode); } @@ -594,7 +595,7 @@ Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace) { var blockChild = null; for (var i = 0, xmlChild; xmlChild = xmlBlock.childNodes[i]; i++) { - if (xmlChild.nodeType == 3) { + if (xmlChild.nodeType == Element.TEXT_NODE) { // Ignore any text at the level. It's all whitespace anyway. continue; } @@ -604,7 +605,7 @@ Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace) { var childBlockElement = null; var childShadowElement = null; for (var j = 0, grandchild; grandchild = xmlChild.childNodes[j]; j++) { - if (grandchild.nodeType == 1) { + if (grandchild.nodeType == Element.ELEMENT_NODE) { if (grandchild.nodeName.toLowerCase() == 'block') { childBlockElement = /** @type {!Element} */ (grandchild); } else if (grandchild.nodeName.toLowerCase() == 'shadow') {