From cf8ee673a995bef4ff4d9437f019d9e41548f411 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Fri, 3 Jun 2016 18:44:40 -0700 Subject: [PATCH] Fix inheritance on rendered connection. Closure compiler on maximum compression breaks badly due to lack of @extends attribute. --- core/connection.js | 4 ---- core/rendered_connection.js | 5 +++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/core/connection.js b/core/connection.js index 91b060d48..1728576a6 100644 --- a/core/connection.js +++ b/core/connection.js @@ -516,8 +516,6 @@ Blockly.Connection.prototype.disconnectInternal_ = function(parentBlock, /** * Respawn the shadow block if there was one connected to the this connection. - * @return {Blockly.Block} The newly spawned shadow block, or null if none was - * spawned. * @private */ Blockly.Connection.prototype.respawnShadow_ = function() { @@ -533,9 +531,7 @@ Blockly.Connection.prototype.respawnShadow_ = function() { } else { throw 'Child block does not have output or previous statement.'; } - return blockShadow; } - return null; }; /** diff --git a/core/rendered_connection.js b/core/rendered_connection.js index 20186b098..c77c53b3a 100644 --- a/core/rendered_connection.js +++ b/core/rendered_connection.js @@ -33,6 +33,7 @@ goog.require('Blockly.Connection'); * Class for a connection between blocks that may be rendered on screen. * @param {!Blockly.Block} source The block establishing this connection. * @param {number} type The type of the connection. + * @extends {Blockly.Connection} * @constructor */ Blockly.RenderedConnection = function(source, type) { @@ -334,8 +335,8 @@ Blockly.RenderedConnection.prototype.respawnShadow_ = function() { // Respawn the shadow block if there is one. var shadow = this.getShadowDom(); if (parentBlock.workspace && shadow && Blockly.Events.recordUndo) { - var blockShadow = - Blockly.RenderedConnection.superClass_.respawnShadow_.call(this); + Blockly.RenderedConnection.superClass_.respawnShadow_.call(this); + var blockShadow = this.targetBlock(); if (!blockShadow) { throw 'Couldn\'t respawn the shadow block that should exist here.'; }