deprecate!: removes deprecated connection functions (#5713)

This commit is contained in:
alschmiedt
2021-12-02 18:21:21 -08:00
committed by GitHub
parent 8b3635ab75
commit c93e1dfd30
4 changed files with 2 additions and 150 deletions

View File

@@ -24,7 +24,7 @@ goog.addDependency('../../core/clipboard.js', ['Blockly.clipboard'], ['Blockly.E
goog.addDependency('../../core/comment.js', ['Blockly.Comment'], ['Blockly.Bubble', 'Blockly.Css', 'Blockly.Events.BlockChange', 'Blockly.Events.BubbleOpen', 'Blockly.Events.utils', 'Blockly.Icon', 'Blockly.Warning', 'Blockly.browserEvents', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/common.js', ['Blockly.common'], ['Blockly.blocks'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/component_manager.js', ['Blockly.ComponentManager'], ['Blockly.utils.array'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/connection.js', ['Blockly.Connection'], ['Blockly.ConnectionType', 'Blockly.Events.BlockMove', 'Blockly.Events.utils', 'Blockly.IASTNodeLocationWithBlock', 'Blockly.Xml', 'Blockly.constants', 'Blockly.serialization.blocks', 'Blockly.utils.deprecation'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/connection.js', ['Blockly.Connection'], ['Blockly.ConnectionType', 'Blockly.Events.BlockMove', 'Blockly.Events.utils', 'Blockly.IASTNodeLocationWithBlock', 'Blockly.Xml', 'Blockly.constants', 'Blockly.serialization.blocks'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/connection_checker.js', ['Blockly.ConnectionChecker'], ['Blockly.Connection', 'Blockly.ConnectionType', 'Blockly.IConnectionChecker', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.registry'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/connection_db.js', ['Blockly.ConnectionDB'], ['Blockly.ConnectionType', 'Blockly.constants'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/connection_type.js', ['Blockly.ConnectionType'], [], {'lang': 'es6', 'module': 'goog'});
@@ -139,7 +139,7 @@ goog.addDependency('../../core/options.js', ['Blockly.Options'], ['Blockly.Theme
goog.addDependency('../../core/positionable_helpers.js', ['Blockly.uiPosition'], ['Blockly.Scrollbar', 'Blockly.utils.Rect', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/procedures.js', ['Blockly.Procedures'], ['Blockly.Events.BlockChange', 'Blockly.Events.utils', 'Blockly.Msg', 'Blockly.Names', 'Blockly.Variables', 'Blockly.Workspace', 'Blockly.Xml', 'Blockly.blocks', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/registry.js', ['Blockly.registry'], [], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/rendered_connection.js', ['Blockly.RenderedConnection'], ['Blockly.Connection', 'Blockly.ConnectionType', 'Blockly.Events.utils', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgMath', 'Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/rendered_connection.js', ['Blockly.RenderedConnection'], ['Blockly.Connection', 'Blockly.ConnectionType', 'Blockly.Events.utils', 'Blockly.common', 'Blockly.internalConstants', 'Blockly.utils.Coordinate', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.svgMath', 'Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/renderers/common/block_rendering.js', ['Blockly.blockRendering'], ['Blockly.blockRendering.BottomRow', 'Blockly.blockRendering.Connection', 'Blockly.blockRendering.ConstantProvider', 'Blockly.blockRendering.Debug', 'Blockly.blockRendering.Drawer', 'Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.Field', 'Blockly.blockRendering.Hat', 'Blockly.blockRendering.IPathObject', 'Blockly.blockRendering.Icon', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.InputConnection', 'Blockly.blockRendering.InputRow', 'Blockly.blockRendering.JaggedEdge', 'Blockly.blockRendering.MarkerSvg', 'Blockly.blockRendering.Measurable', 'Blockly.blockRendering.NextConnection', 'Blockly.blockRendering.OutputConnection', 'Blockly.blockRendering.PathObject', 'Blockly.blockRendering.PreviousConnection', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Renderer', 'Blockly.blockRendering.RoundCorner', 'Blockly.blockRendering.Row', 'Blockly.blockRendering.SpacerRow', 'Blockly.blockRendering.SquareCorner', 'Blockly.blockRendering.StatementInput', 'Blockly.blockRendering.TopRow', 'Blockly.blockRendering.Types', 'Blockly.blockRendering.debug', 'Blockly.registry', 'Blockly.utils.deprecation'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/renderers/common/constants.js', ['Blockly.blockRendering.ConstantProvider'], ['Blockly.ConnectionType', 'Blockly.utils.Svg', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.parsing', 'Blockly.utils.svgPaths', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/renderers/common/debug.js', ['Blockly.blockRendering.debug'], [], {'lang': 'es6', 'module': 'goog'});

View File

@@ -28,48 +28,6 @@ suite('Connection', function() {
sharedTestTeardown.call(this);
});
test('Deprecated - canConnectWithReason passes', function() {
const deprecateWarnSpy = createDeprecationWarningStub();
const conn1 = this.createConnection(Blockly.PREVIOUS_NAME);
const conn2 = this.createConnection(Blockly.NEXT_NAME);
chai.assert.equal(conn1.canConnectWithReason(conn2),
Blockly.Connection.CAN_CONNECT);
assertSingleDeprecationWarningCall(deprecateWarnSpy,
'Connection.prototype.canConnectWithReason');
});
test('Deprecated - canConnectWithReason fails', function() {
const deprecateWarnSpy = createDeprecationWarningStub();
const conn1 = this.createConnection(Blockly.PREVIOUS_NAME);
const conn2 = this.createConnection(Blockly.OUTPUT_VALUE);
chai.assert.equal(conn1.canConnectWithReason(conn2),
Blockly.Connection.REASON_WRONG_TYPE);
assertSingleDeprecationWarningCall(deprecateWarnSpy,
'Connection.prototype.canConnectWithReason');
});
test('Deprecated - checkConnection passes', function() {
const deprecateWarnSpy = createDeprecationWarningStub();
const conn1 = this.createConnection(Blockly.PREVIOUS_NAME);
const conn2 = this.createConnection(Blockly.NEXT_NAME);
chai.assert.doesNotThrow(function() {
conn1.checkConnection(conn2);
});
assertSingleDeprecationWarningCall(deprecateWarnSpy,
'Connection.prototype.checkConnection');
});
test('Deprecated - checkConnection fails', function() {
const deprecateWarnSpy = createDeprecationWarningStub();
const conn1 = this.createConnection(Blockly.PREVIOUS_NAME);
const conn2 = this.createConnection(Blockly.OUTPUT_VALUE);
chai.assert.throws(function() {
conn1.checkConnection(conn2);
});
assertSingleDeprecationWarningCall(deprecateWarnSpy,
'Connection.prototype.checkConnection');
});
suite('Set Shadow', function() {
function assertBlockMatches(block, isShadow, opt_id) {
chai.assert.equal(block.isShadow(), isShadow,