Skip to content

Commit c2f4e8e

Browse files
committed
Merge branch 'main' into update-to-blockly-11
2 parents 92ad383 + 230f173 commit c2f4e8e

2 files changed

Lines changed: 1 addition & 19 deletions

File tree

block-lexical-variables/src/blocks/variable-get-set.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Blockly.Blocks['lexical_variable_get'] = {
2121
init: function() {
2222
this.setStyle('variable_blocks');
2323
this.fieldVar_ = new FieldLexicalVariable(' ');
24-
this.fieldVar_.setBlock(this);
2524
this.appendDummyInput()
2625
.appendField(Blockly.Msg.LANG_VARIABLES_GET_TITLE_GET)
2726
.appendField(this.fieldVar_, 'VAR');
@@ -143,7 +142,6 @@ Blockly.Blocks['lexical_variable_set'] = {
143142
init: function() {
144143
this.setStyle('variable_blocks');
145144
this.fieldVar_ = new FieldLexicalVariable(' ');
146-
this.fieldVar_.setBlock(this);
147145
this.appendValueInput('VALUE')
148146
.appendField(Blockly.Msg.LANG_VARIABLES_SET_TITLE_SET)
149147
.appendField(this.fieldVar_, 'VAR')

block-lexical-variables/src/fields/field_lexical_variable.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -136,22 +136,6 @@ FieldLexicalVariable.prototype.doClassValidation_ = function(
136136
return /** @type {string} */ (opt_newValue);
137137
};
138138

139-
/**
140-
* Get the block holding this drop-down variable chooser.
141-
* @return {string} Block holding this drop-down variable chooser.
142-
*/
143-
FieldLexicalVariable.prototype.getBlock = function() {
144-
return this.block_;
145-
};
146-
147-
/**
148-
* Set the block holding this drop-down variable chooser.
149-
* @param {?Blockly.Block} block Block holding this drop-down variable chooser.
150-
*/
151-
FieldLexicalVariable.prototype.setBlock = function(block) {
152-
this.block_ = block;
153-
};
154-
155139
// [lyn, 11/10/12] Returns the names of all global definitions as a list of
156140
// strings [lyn, 11/18/12] * Removed from prototype and stripped off "global"
157141
// prefix (add it elsewhere) * Add optional excluded block argument as in
@@ -205,7 +189,7 @@ FieldLexicalVariable.getGlobalNames = function(optExcludedBlock) {
205189
// Shared.showPrefixToUser is true, non-global names are prefixed with labels
206190
// specified in blocklyeditor.js
207191
FieldLexicalVariable.prototype.getNamesInScope = function() {
208-
return FieldLexicalVariable.getNamesInScope(this.block_);
192+
return FieldLexicalVariable.getNamesInScope(this.sourceBlock_);
209193
};
210194

211195
/**

0 commit comments

Comments
 (0)