Fix require statements.

Also throw error instead of string.
And stop using goog.asserts.
This commit is contained in:
Neil Fraser
2019-05-15 15:41:48 -07:00
committed by Neil Fraser
parent 49954e0cec
commit 25bc3e0268
7 changed files with 13 additions and 11 deletions

View File

@@ -30,8 +30,6 @@ goog.require('Blockly.BlockAnimations');
goog.require('Blockly.Events.BlockMove');
goog.require('Blockly.RenderedConnection');
goog.require('goog.math.Coordinate');
/**
* Class that controls updates to connections during drags. It is primarily
@@ -660,7 +658,8 @@ Blockly.InsertionMarkerManager.prototype.disconnectMarker_ = function() {
}
if (imConn.targetConnection) {
throw 'markerConnection_ still connected at the end of disconnectInsertionMarker';
throw Error('markerConnection_ still connected at the end of ' +
'disconnectInsertionMarker');
}
this.markerConnection_ = null;
@@ -679,8 +678,10 @@ Blockly.InsertionMarkerManager.prototype.connectMarker_ = function() {
var imBlock = isLastInStack ? this.lastMarker_ : this.firstMarker_;
var imConn = imBlock.getMatchingConnection(local.sourceBlock_, local);
goog.asserts.assert(imConn != this.markerConnection_,
'Made it to connectMarker_ even though the marker isn\'t changing');
if (imConn == this.markerConnection_) {
throw Error('Made it to connectMarker_ even though the marker isn\'t ' +
'changing');
}
// Render disconnected from everything else so that we have a valid
// connection location.