From 3e62ffc20abe024e90a3639cce66b7b7aa7ed0b0 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Wed, 24 Jan 2018 11:26:41 -0800 Subject: [PATCH] Split at higher level for multiline function calls --- blocks/procedures.js | 4 +-- core/block_drag_surface.js | 8 +++--- core/block_svg.js | 40 +++++++++++++++--------------- core/blockly.js | 11 +++++--- core/bubble.js | 8 +++--- core/contextmenu.js | 12 ++++----- core/extensions.js | 8 +++--- core/field.js | 4 +-- core/field_dropdown.js | 12 ++++----- core/field_image.js | 4 +-- core/field_textinput.js | 12 ++++----- core/flyout_base.js | 9 ++++--- core/icon.js | 8 +++--- core/mutator.js | 2 +- core/toolbox.js | 10 +++----- core/workspace_drag_surface_svg.js | 16 ++++++------ core/workspace_dragger.js | 4 +-- core/workspace_svg.js | 4 +-- core/xml.js | 8 +++--- 19 files changed, 93 insertions(+), 91 deletions(-) diff --git a/blocks/procedures.js b/blocks/procedures.js index 87b35cbe4..8e890a767 100644 --- a/blocks/procedures.js +++ b/blocks/procedures.js @@ -182,8 +182,8 @@ Blockly.Blocks['procedures_defnoreturn'] = { // Check/uncheck the allow statement box. if (this.getInput('RETURN')) { - containerBlock.setFieldValue(this.hasStatements_ ? 'TRUE' : 'FALSE', - 'STATEMENTS'); + containerBlock.setFieldValue( + this.hasStatements_ ? 'TRUE' : 'FALSE', 'STATEMENTS'); } else { containerBlock.getInput('STATEMENT_INPUT').setVisible(false); } diff --git a/core/block_drag_surface.js b/core/block_drag_surface.js index b6b205b29..be1edb3b0 100644 --- a/core/block_drag_surface.js +++ b/core/block_drag_surface.js @@ -113,8 +113,8 @@ Blockly.BlockDragSurfaceSvg.prototype.createDom = function() { * surface. */ Blockly.BlockDragSurfaceSvg.prototype.setBlocksAndShow = function(blocks) { - goog.asserts.assert(this.dragGroup_.childNodes.length == 0, - 'Already dragging a block.'); + goog.asserts.assert( + this.dragGroup_.childNodes.length == 0, 'Already dragging a block.'); // appendChild removes the blocks from the previous parent this.dragGroup_.appendChild(blocks); this.SVG_.style.display = 'block'; @@ -214,7 +214,7 @@ Blockly.BlockDragSurfaceSvg.prototype.clearAndHide = function(opt_newSurface) { this.dragGroup_.removeChild(this.getCurrentBlock()); } this.SVG_.style.display = 'none'; - goog.asserts.assert(this.dragGroup_.childNodes.length == 0, - 'Drag group was not cleared.'); + goog.asserts.assert( + this.dragGroup_.childNodes.length == 0, 'Drag group was not cleared.'); this.surfaceXY_ = null; }; diff --git a/core/block_svg.js b/core/block_svg.js index dda26f9c2..ae4087c53 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -149,8 +149,8 @@ Blockly.BlockSvg.prototype.initSvg = function() { this.updateColour(); this.updateMovable(); if (!this.workspace.options.readOnly && !this.eventsInit_) { - Blockly.bindEventWithChecks_(this.getSvgRoot(), 'mousedown', this, - this.onMouseDown_); + Blockly.bindEventWithChecks_( + this.getSvgRoot(), 'mousedown', this, this.onMouseDown_); } this.eventsInit_ = true; @@ -708,12 +708,12 @@ Blockly.BlockSvg.prototype.setDragging = function(adding) { group.skew_ = ''; Blockly.draggingConnections_ = Blockly.draggingConnections_.concat(this.getConnections_(true)); - Blockly.utils.addClass(/** @type {!Element} */ (this.svgGroup_), - 'blocklyDragging'); + Blockly.utils.addClass( + /** @type {!Element} */ (this.svgGroup_), 'blocklyDragging'); } else { Blockly.draggingConnections_ = []; - Blockly.utils.removeClass(/** @type {!Element} */ (this.svgGroup_), - 'blocklyDragging'); + Blockly.utils.removeClass( + /** @type {!Element} */ (this.svgGroup_), 'blocklyDragging'); } // Recurse through all blocks attached under this one. for (var i = 0; i < this.childBlocks_.length; i++) { @@ -726,11 +726,11 @@ Blockly.BlockSvg.prototype.setDragging = function(adding) { */ Blockly.BlockSvg.prototype.updateMovable = function() { if (this.isMovable()) { - Blockly.utils.addClass(/** @type {!Element} */ (this.svgGroup_), - 'blocklyDraggable'); + Blockly.utils.addClass( + /** @type {!Element} */ (this.svgGroup_), 'blocklyDraggable'); } else { - Blockly.utils.removeClass(/** @type {!Element} */ (this.svgGroup_), - 'blocklyDraggable'); + Blockly.utils.removeClass( + /** @type {!Element} */ (this.svgGroup_), 'blocklyDraggable'); } }; @@ -877,8 +877,8 @@ Blockly.BlockSvg.disposeUiStep_ = function(clone, rtl, start, workspaceScale) { var scale = (1 - percent) * workspaceScale; clone.setAttribute('transform', 'translate(' + x + ',' + y + ')' + ' scale(' + scale + ')'); - setTimeout(Blockly.BlockSvg.disposeUiStep_, 10, clone, rtl, start, - workspaceScale); + setTimeout( + Blockly.BlockSvg.disposeUiStep_, 10, clone, rtl, start, workspaceScale); } }; @@ -971,13 +971,13 @@ Blockly.BlockSvg.disconnectUiStep_ = function(group, magnitude, start) { if (percent > 1) { group.skew_ = ''; } else { - var skew = Math.round(Math.sin(percent * Math.PI * WIGGLES) * - (1 - percent) * magnitude); + var skew = Math.round( + Math.sin(percent * Math.PI * WIGGLES) * (1 - percent) * magnitude); group.skew_ = 'skewX(' + skew + ')'; Blockly.BlockSvg.disconnectUiStop_.group = group; Blockly.BlockSvg.disconnectUiStop_.pid = - setTimeout(Blockly.BlockSvg.disconnectUiStep_, 10, group, magnitude, - start); + setTimeout( + Blockly.BlockSvg.disconnectUiStep_, 10, group, magnitude, start); } group.setAttribute('transform', group.translate_ + group.skew_); }; @@ -1241,16 +1241,16 @@ Blockly.BlockSvg.prototype.setHighlighted = function(highlighted) { * Select this block. Highlight it visually. */ Blockly.BlockSvg.prototype.addSelect = function() { - Blockly.utils.addClass(/** @type {!Element} */ (this.svgGroup_), - 'blocklySelected'); + Blockly.utils.addClass( + /** @type {!Element} */ (this.svgGroup_), 'blocklySelected'); }; /** * Unselect this block. Remove its highlighting. */ Blockly.BlockSvg.prototype.removeSelect = function() { - Blockly.utils.removeClass(/** @type {!Element} */ (this.svgGroup_), - 'blocklySelected'); + Blockly.utils.removeClass( + /** @type {!Element} */ (this.svgGroup_), 'blocklySelected'); }; /** diff --git a/core/blockly.js b/core/blockly.js index e3b222993..b835cc3bc 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -308,7 +308,8 @@ Blockly.hideChaff = function(opt_allowToolbox) { */ Blockly.addChangeListener = function(func) { // Backwards compatibility from before there could be multiple workspaces. - console.warn('Deprecated call to Blockly.addChangeListener, ' + + console.warn( + 'Deprecated call to Blockly.addChangeListener, ' + 'use workspace.addChangeListener instead.'); return Blockly.getMainWorkspace().addChangeListener(func); }; @@ -382,12 +383,14 @@ Blockly.defineBlocksWithJsonArray = function(jsonArray) { for (var i = 0, elem; elem = jsonArray[i]; i++) { var typename = elem.type; if (typename == null || typename === '') { - console.warn('Block definition #' + i + + console.warn( + 'Block definition #' + i + ' in JSON array is missing a type attribute. Skipping.'); } else { if (Blockly.Blocks[typename]) { - console.warn('Block definition #' + i + - ' in JSON array overwrites prior definition of "' + typename + '".'); + console.warn( + 'Block definition #' + i + ' in JSON array' + + ' overwrites prior definition of "' + typename + '".'); } Blockly.Blocks[typename] = { init: Blockly.jsonInitFactory_(elem) diff --git a/core/bubble.js b/core/bubble.js index e34e8a14d..df3b69e3f 100644 --- a/core/bubble.js +++ b/core/bubble.js @@ -75,11 +75,11 @@ Blockly.Bubble = function(workspace, content, shape, anchorXY, this.rendered_ = true; if (!workspace.options.readOnly) { - Blockly.bindEventWithChecks_(this.bubbleBack_, 'mousedown', this, - this.bubbleMouseDown_); + Blockly.bindEventWithChecks_( + this.bubbleBack_, 'mousedown', this, this.bubbleMouseDown_); if (this.resizeGroup_) { - Blockly.bindEventWithChecks_(this.resizeGroup_, 'mousedown', this, - this.resizeMouseDown_); + Blockly.bindEventWithChecks_( + this.resizeGroup_, 'mousedown', this, this.resizeMouseDown_); } } }; diff --git a/core/contextmenu.js b/core/contextmenu.js index 0a4bf9210..ba25701ea 100644 --- a/core/contextmenu.js +++ b/core/contextmenu.js @@ -67,8 +67,8 @@ Blockly.ContextMenu.show = function(e, options, rtl) { } var menu = Blockly.ContextMenu.populate_(options, rtl); - goog.events.listen(menu, goog.ui.Component.EventType.ACTION, - Blockly.ContextMenu.hide); + goog.events.listen( + menu, goog.ui.Component.EventType.ACTION, Blockly.ContextMenu.hide); Blockly.ContextMenu.position_(menu, e, rtl); // 1ms delay is required for focusing on context menus because some other @@ -98,8 +98,8 @@ Blockly.ContextMenu.populate_ = function(options, rtl) { menu.addChild(menuItem, true); menuItem.setEnabled(option.enabled); if (option.enabled) { - goog.events.listen(menuItem, goog.ui.Component.EventType.ACTION, - option.callback); + goog.events.listen( + menuItem, goog.ui.Component.EventType.ACTION, option.callback); menuItem.handleContextMenu = function(/* e */) { // Right-clicking on menu option should count as a click. goog.events.dispatchEvent(this, goog.ui.Component.EventType.ACTION); @@ -154,8 +154,8 @@ Blockly.ContextMenu.createWidget_ = function(menu) { var menuDom = menu.getElement(); Blockly.utils.addClass(menuDom, 'blocklyContextMenu'); // Prevent system context menu when right-clicking a Blockly context menu. - Blockly.bindEventWithChecks_(menuDom, 'contextmenu', null, - Blockly.utils.noEvent); + Blockly.bindEventWithChecks_( + menuDom, 'contextmenu', null, Blockly.utils.noEvent); // Enable autofocus after the initial render to avoid issue #1329. menu.setAllowAutoFocus(true); }; diff --git a/core/extensions.js b/core/extensions.js index 37b9e5423..016fc4ac5 100644 --- a/core/extensions.js +++ b/core/extensions.js @@ -100,10 +100,10 @@ Blockly.Extensions.registerMutator = function(name, mixinObj, opt_helperFn, var errorPrefix = 'Error when registering mutator "' + name + '": '; // Sanity check the mixin object before registering it. - Blockly.Extensions.checkHasFunction_(errorPrefix, mixinObj.domToMutation, - 'domToMutation'); - Blockly.Extensions.checkHasFunction_(errorPrefix, mixinObj.mutationToDom, - 'mutationToDom'); + Blockly.Extensions.checkHasFunction_( + errorPrefix, mixinObj.domToMutation, 'domToMutation'); + Blockly.Extensions.checkHasFunction_( + errorPrefix, mixinObj.mutationToDom, 'mutationToDom'); var hasMutatorDialog = Blockly.Extensions.checkMutatorDialog_(mixinObj, errorPrefix); diff --git a/core/field.js b/core/field.js index 6957abc44..66f457a3a 100644 --- a/core/field.js +++ b/core/field.js @@ -157,8 +157,8 @@ Blockly.Field.prototype.init = function() { this.updateEditable(); this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_); this.mouseDownWrapper_ = - Blockly.bindEventWithChecks_(this.fieldGroup_, 'mousedown', this, - this.onMouseDown_); + Blockly.bindEventWithChecks_( + this.fieldGroup_, 'mousedown', this, this.onMouseDown_); // Force a render. this.render_(); }; diff --git a/core/field_dropdown.js b/core/field_dropdown.js index 2e64228cd..2a1ceec9d 100644 --- a/core/field_dropdown.js +++ b/core/field_dropdown.js @@ -180,8 +180,8 @@ Blockly.FieldDropdown.prototype.addTouchStartListener_ = function(menu) { // Highlight the menu item. control.handleMouseDown(e); } - menu.getHandler().listen(menu.getElement(), goog.events.EventType.TOUCHSTART, - callback); + menu.getHandler().listen( + menu.getElement(), goog.events.EventType.TOUCHSTART, callback); }; /** @@ -196,8 +196,8 @@ Blockly.FieldDropdown.prototype.addTouchEndListener_ = function(menu) { // Activate the menu item. control.performActionInternal(e); } - menu.getHandler().listen(menu.getElement(), goog.events.EventType.TOUCHEND, - callbackTouchEnd); + menu.getHandler().listen( + menu.getElement(), goog.events.EventType.TOUCHEND, callbackTouchEnd); }; /** @@ -490,8 +490,8 @@ Blockly.FieldDropdown.prototype.renderSelectedImage_ = function() { 'height': this.imageJson_.height + 'px', 'width': this.imageJson_.width + 'px' }, this.fieldGroup_); - this.imageElement_.setAttributeNS('http://www.w3.org/1999/xlink', - 'xlink:href', this.imageJson_.src); + this.imageElement_.setAttributeNS( + 'http://www.w3.org/1999/xlink', 'xlink:href', this.imageJson_.src); // Insert dropdown arrow. this.textElement_.appendChild(this.arrow_); var arrowWidth = Blockly.Field.getCachedWidth(this.arrow_); diff --git a/core/field_image.js b/core/field_image.js index 8d691b2d8..54882d199 100644 --- a/core/field_image.js +++ b/core/field_image.js @@ -114,8 +114,8 @@ Blockly.FieldImage.prototype.dispose = function() { Blockly.FieldImage.prototype.maybeAddClickHandler_ = function() { if (this.clickHandler_) { this.mouseDownWrapper_ = - Blockly.bindEventWithChecks_(this.fieldGroup_, 'mousedown', this, - this.onMouseDown_); + Blockly.bindEventWithChecks_( + this.fieldGroup_, 'mousedown', this, this.onMouseDown_); } }; diff --git a/core/field_textinput.js b/core/field_textinput.js index 4c51be13c..40ae94e54 100644 --- a/core/field_textinput.js +++ b/core/field_textinput.js @@ -206,16 +206,16 @@ Blockly.FieldTextInput.prototype.showInlineEditor_ = function(quietInput) { Blockly.FieldTextInput.prototype.bindEvents_ = function(htmlInput) { // Bind to keydown -- trap Enter without IME and Esc to hide. htmlInput.onKeyDownWrapper_ = - Blockly.bindEventWithChecks_(htmlInput, 'keydown', this, - this.onHtmlInputKeyDown_); + Blockly.bindEventWithChecks_( + htmlInput, 'keydown', this, this.onHtmlInputKeyDown_); // Bind to keyup -- trap Enter; resize after every keystroke. htmlInput.onKeyUpWrapper_ = - Blockly.bindEventWithChecks_(htmlInput, 'keyup', this, - this.onHtmlInputChange_); + Blockly.bindEventWithChecks_( + htmlInput, 'keyup', this, this.onHtmlInputChange_); // Bind to keyPress -- repeatedly resize when holding down a key. htmlInput.onKeyPressWrapper_ = - Blockly.bindEventWithChecks_(htmlInput, 'keypress', this, - this.onHtmlInputChange_); + Blockly.bindEventWithChecks_( + htmlInput, 'keypress', this, this.onHtmlInputChange_); htmlInput.onWorkspaceChangeWrapper_ = this.resizeEditor_.bind(this); this.workspace_.addChangeListener(htmlInput.onWorkspaceChangeWrapper_); }; diff --git a/core/flyout_base.js b/core/flyout_base.js index 02f99f8a5..d845ae8a6 100644 --- a/core/flyout_base.js +++ b/core/flyout_base.js @@ -241,8 +241,8 @@ Blockly.Flyout.prototype.init = function(targetWorkspace) { // Dragging the flyout up and down. Array.prototype.push.apply(this.eventWrappers_, - Blockly.bindEventWithChecks_(this.svgBackground_, 'mousedown', this, - this.onMouseDown_)); + Blockly.bindEventWithChecks_( + this.svgBackground_, 'mousedown', this, this.onMouseDown_)); // A flyout connected to a workspace doesn't have its own current gesture. this.workspace_.getGesture = @@ -636,8 +636,9 @@ Blockly.Flyout.prototype.initFlyoutButton_ = function(button, x, y) { button.show(); // Clicking on a flyout button or label is a lot like clicking on the // flyout background. - this.listeners_.push(Blockly.bindEventWithChecks_(buttonSvg, 'mousedown', - this, this.onMouseDown_)); + this.listeners_.push( + Blockly.bindEventWithChecks_( + buttonSvg, 'mousedown', this, this.onMouseDown_)); this.buttons_.push(button); }; diff --git a/core/icon.js b/core/icon.js index e2a817e85..88b7fb689 100644 --- a/core/icon.js +++ b/core/icon.js @@ -79,14 +79,14 @@ Blockly.Icon.prototype.createIcon = function() { this.iconGroup_ = Blockly.utils.createSvgElement('g', {'class': 'blocklyIconGroup'}, null); if (this.block_.isInFlyout) { - Blockly.utils.addClass(/** @type {!Element} */ (this.iconGroup_), - 'blocklyIconGroupReadonly'); + Blockly.utils.addClass( + /** @type {!Element} */ (this.iconGroup_), 'blocklyIconGroupReadonly'); } this.drawIcon_(this.iconGroup_); this.block_.getSvgRoot().appendChild(this.iconGroup_); - Blockly.bindEventWithChecks_(this.iconGroup_, 'mouseup', this, - this.iconClick_); + Blockly.bindEventWithChecks_( + this.iconGroup_, 'mouseup', this, this.iconClick_); this.updateEditable(); }; diff --git a/core/mutator.js b/core/mutator.js index f90165bf2..27ee32b02 100644 --- a/core/mutator.js +++ b/core/mutator.js @@ -209,7 +209,7 @@ Blockly.Mutator.prototype.resizeBubble_ = function() { this.workspaceHeight_ = height; // Resize the bubble. this.bubble_.setBubbleSize(width + doubleBorderWidth, - height + doubleBorderWidth); + width + doubleBorderWidth, height + doubleBorderWidth); this.svgDialog_.setAttribute('width', this.workspaceWidth_); this.svgDialog_.setAttribute('height', this.workspaceHeight_); } diff --git a/core/toolbox.js b/core/toolbox.js index e71a02584..429720246 100644 --- a/core/toolbox.js +++ b/core/toolbox.js @@ -189,8 +189,8 @@ Blockly.Toolbox.prototype.init = function() { } else { this.flyout_ = new Blockly.VerticalFlyout(workspaceOptions); } - goog.dom.insertSiblingAfter(this.flyout_.createDom('svg'), - this.workspace_.getParentSvg()); + goog.dom.insertSiblingAfter( + this.flyout_.createDom('svg'), this.workspace_.getParentSvg()); this.flyout_.init(workspace); this.config_['cleardotPath'] = workspace.options.pathToMedia + '1x1.gif'; @@ -427,8 +427,7 @@ Blockly.Toolbox.prototype.clearSelection = function() { * @package */ Blockly.Toolbox.prototype.addStyle = function(style) { - Blockly.utils.addClass(/** @type {!Element} */ (this.HtmlDiv), - style); + Blockly.utils.addClass(/** @type {!Element} */ (this.HtmlDiv), style); }; /** @@ -437,8 +436,7 @@ Blockly.Toolbox.prototype.addStyle = function(style) { * @package */ Blockly.Toolbox.prototype.removeStyle = function(style) { - Blockly.utils.removeClass(/** @type {!Element} */ (this.HtmlDiv), - style); + Blockly.utils.removeClass(/** @type {!Element} */ (this.HtmlDiv), style); }; /** diff --git a/core/workspace_drag_surface_svg.js b/core/workspace_drag_surface_svg.js index adb5905e9..3227d9300 100644 --- a/core/workspace_drag_surface_svg.js +++ b/core/workspace_drag_surface_svg.js @@ -115,8 +115,8 @@ Blockly.WorkspaceDragSurfaceSvg.prototype.translateSurface = function(x, y) { y = y.toFixed(0); this.SVG_.style.display = 'block'; - Blockly.utils.setCssTransform(this.SVG_, - 'translate3d(' + x + 'px, ' + y + 'px, 0px)'); + Blockly.utils.setCssTransform( + this.SVG_, 'translate3d(' + x + 'px, ' + y + 'px, 0px)'); }; /** @@ -157,8 +157,8 @@ Blockly.WorkspaceDragSurfaceSvg.prototype.clearAndHide = function(newSurface) { Blockly.utils.insertAfter_(bubbleCanvas, blockCanvas); // Hide the drag surface. this.SVG_.style.display = 'none'; - goog.asserts.assert(this.SVG_.childNodes.length == 0, - 'Drag surface was not cleared.'); + goog.asserts.assert( + this.SVG_.childNodes.length == 0, 'Drag surface was not cleared.'); Blockly.utils.setCssTransform(this.SVG_, ''); this.previousSibling_ = null; }; @@ -177,13 +177,13 @@ Blockly.WorkspaceDragSurfaceSvg.prototype.clearAndHide = function(newSurface) { */ Blockly.WorkspaceDragSurfaceSvg.prototype.setContentsAndShow = function( blockCanvas, bubbleCanvas, previousSibling, width, height, scale) { - goog.asserts.assert(this.SVG_.childNodes.length == 0, - 'Already dragging a block.'); + goog.asserts.assert( + this.SVG_.childNodes.length == 0, 'Already dragging a block.'); this.previousSibling_ = previousSibling; // Make sure the blocks and bubble canvas are scaled appropriately. blockCanvas.setAttribute('transform', 'translate(0, 0) scale(' + scale + ')'); - bubbleCanvas.setAttribute('transform', - 'translate(0, 0) scale(' + scale + ')'); + bubbleCanvas.setAttribute( + 'transform', 'translate(0, 0) scale(' + scale + ')'); this.SVG_.setAttribute('width', width); this.SVG_.setAttribute('height', height); this.SVG_.appendChild(blockCanvas); diff --git a/core/workspace_dragger.js b/core/workspace_dragger.js index a6b0453da..09cb9b818 100644 --- a/core/workspace_dragger.js +++ b/core/workspace_dragger.js @@ -61,8 +61,8 @@ Blockly.WorkspaceDragger = function(workspace) { * @type {!goog.math.Coordinate} * @private */ - this.startScrollXY_ = new goog.math.Coordinate(workspace.scrollX, - workspace.scrollY); + this.startScrollXY_ = new goog.math.Coordinate( + workspace.scrollX, workspace.scrollY); }; /** diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 81132cee5..38990ac14 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -965,8 +965,8 @@ Blockly.WorkspaceSvg.prototype.deleteVariableById = function(id) { * @package */ Blockly.WorkspaceSvg.prototype.createVariable = function(name, opt_type, opt_id) { - var newVar = Blockly.WorkspaceSvg.superClass_.createVariable.call(this, name, - opt_type, opt_id); + var newVar = Blockly.WorkspaceSvg.superClass_.createVariable.call( + this, name, opt_type, opt_id); this.refreshToolboxSelection_(); return newVar; }; diff --git a/core/xml.js b/core/xml.js index b4033e896..0354841c4 100644 --- a/core/xml.js +++ b/core/xml.js @@ -584,8 +584,8 @@ Blockly.Xml.domToVariables = function(xmlVariables, workspace) { Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace) { var block = null; var prototypeName = xmlBlock.getAttribute('type'); - goog.asserts.assert(prototypeName, 'Block type unspecified: %s', - xmlBlock.outerHTML); + goog.asserts.assert( + prototypeName, 'Block type unspecified: %s', xmlBlock.outerHTML); var id = xmlBlock.getAttribute('id'); block = workspace.newBlock(prototypeName, id); @@ -729,8 +729,8 @@ Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace) { // Ensure all children are also shadows. var children = block.getChildren(); for (var i = 0, child; child = children[i]; i++) { - goog.asserts.assert(child.isShadow(), - 'Shadow block not allowed non-shadow child.'); + goog.asserts.assert( + child.isShadow(), 'Shadow block not allowed non-shadow child.'); } // Ensure this block doesn't have any variable inputs. goog.asserts.assert(block.getVarModels().length == 0,