mirror of
https://github.com/google/blockly.git
synced 2026-01-06 00:20:37 +01:00
fix: Fix blocks with mutators. (#6440)
* refactor: Revert the Mutator/Icon constructor API changes with a deprecation warning. * fix: Update the block definitions to use the new Mutator constructor.
This commit is contained in:
@@ -133,7 +133,7 @@ blocks['lists_create_with'] = {
|
||||
this.itemCount_ = 3;
|
||||
this.updateShape_();
|
||||
this.setOutput(true, 'Array');
|
||||
this.setMutator(new Mutator(['lists_create_with_item']));
|
||||
this.setMutator(new Mutator(['lists_create_with_item'], this));
|
||||
this.setTooltip(Msg['LISTS_CREATE_WITH_TOOLTIP']);
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -461,7 +461,7 @@ blocks['procedures_defnoreturn'] = {
|
||||
.appendField(Msg['PROCEDURES_DEFNORETURN_TITLE'])
|
||||
.appendField(nameField, 'NAME')
|
||||
.appendField('', 'PARAMS');
|
||||
this.setMutator(new Mutator(['procedures_mutatorarg']));
|
||||
this.setMutator(new Mutator(['procedures_mutatorarg'], this));
|
||||
if ((this.workspace.options.comments ||
|
||||
(this.workspace.options.parentWorkspace &&
|
||||
this.workspace.options.parentWorkspace.options.comments)) &&
|
||||
@@ -507,7 +507,7 @@ blocks['procedures_defreturn'] = {
|
||||
this.appendValueInput('RETURN')
|
||||
.setAlign(Align.RIGHT)
|
||||
.appendField(Msg['PROCEDURES_DEFRETURN_RETURN']);
|
||||
this.setMutator(new Mutator(['procedures_mutatorarg']));
|
||||
this.setMutator(new Mutator(['procedures_mutatorarg'], this));
|
||||
if ((this.workspace.options.comments ||
|
||||
(this.workspace.options.parentWorkspace &&
|
||||
this.workspace.options.parentWorkspace.options.comments)) &&
|
||||
|
||||
@@ -864,7 +864,7 @@ const TEXT_JOIN_EXTENSION = function() {
|
||||
this.itemCount_ = 2;
|
||||
this.updateShape_();
|
||||
// Configure the mutator UI.
|
||||
this.setMutator(new Mutator(['text_create_join_item']));
|
||||
this.setMutator(new Mutator(['text_create_join_item'], this));
|
||||
};
|
||||
|
||||
// Update the tooltip of 'text_append' block to reference the variable.
|
||||
|
||||
Reference in New Issue
Block a user