From dbd40449f639e3c40ab03c6458d9e7096d61429a Mon Sep 17 00:00:00 2001 From: Michael Gallagher Date: Fri, 24 Oct 2025 14:29:38 -0700 Subject: [PATCH 01/11] Change Field setText() to setValue() https://github.com/google/blockly/commit/520aa600a6532d0786461eca7c88199e92640677#diff-c31ad3fa2aed6dafcf75d583f81f27b4349b02e43e84efdf900f124ab61ddaf0L821-L834 --- block-lexical-variables/src/blocks/procedures.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block-lexical-variables/src/blocks/procedures.js b/block-lexical-variables/src/blocks/procedures.js index 21d7a83..41c738f 100644 --- a/block-lexical-variables/src/blocks/procedures.js +++ b/block-lexical-variables/src/blocks/procedures.js @@ -267,7 +267,7 @@ Blockly.Blocks['procedures_defnoreturn'] = { // procedure arguments_ list rather than mutate that list, but I'd be // wrong! Turns out that *not* mutating list here causes trouble below in // the line - // Blockly.Field.prototype.setText.call(mutatorarg.getTitle_("NAME"), + // Blockly.Field.prototype.setValue.call(mutatorarg.getTitle_("NAME"), // newParamName); The reason is that this fires a change event in // mutator workspace, which causes a call to the proc decl compose() // method, and when it detects a difference in the arguments it calls @@ -307,13 +307,13 @@ Blockly.Blocks['procedures_defnoreturn'] = { // will be invoked several times, and on one of those times, it will // find new param name in the procedures arguments_ instance variable // and will try to renumber it (e.g. "a" -> "a2"). To avoid this, - // invoke the setText method of its Field s superclass directly. + // invoke the setValue method of its Field superclass directly. // I.e., can't do this: // mutatorarg.getTitle_("NAME").setValue(newParamName); so instead do // this: mutatorarg.getField('NAME').setValue(newParamName); // mutatorarg.getField("NAME").doValueUpdate_(newParamName); - // Blockly.Field.prototype.setText.call(mutatorarg.getField("NAME"), + // Blockly.Field.prototype.setValue.call(mutatorarg.getField("NAME"), // newParamName); } } From 20291b219961a48c025a1fc60ec8504c264731b8 Mon Sep 17 00:00:00 2001 From: Michael Gallagher Date: Fri, 24 Oct 2025 14:33:46 -0700 Subject: [PATCH 02/11] Change Connection check_ to getCheck() https://github.com/google/blockly/commit/85013f83b25d1c1e837b3cb0771414a6357aecd9#diff-dd85563e074ebb74e4c34eee01568971430f3cb7a6b846feef8044ad8d5dcd61L54-R54 https://github.com/google/blockly/blob/blockly-v11.2.2/core/connection.ts#L428 --- block-lexical-variables/src/utilities.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block-lexical-variables/src/utilities.js b/block-lexical-variables/src/utilities.js index 7ea76a7..d17b146 100644 --- a/block-lexical-variables/src/utilities.js +++ b/block-lexical-variables/src/utilities.js @@ -24,12 +24,12 @@ import './msg.js'; export const InstantInTime = function(myConn, otherConn) { if (!myConn.sourceBlock_.rendered || !otherConn.sourceBlock_.rendered) { - if (otherConn.check_ && !otherConn.check_.includes('InstantInTime')) { + if (otherConn.getCheck() && !otherConn.getCheck().includes('InstantInTime')) { otherConn.sourceBlock_.badBlock(); } return true; } - return !otherConn.check_ || otherConn.check_.includes('InstantInTime'); + return !otherConn.getCheck() || otherConn.getCheck().includes('InstantInTime'); }; From 3a9ea20e3719d82b9bbc55855086a58c5a7332a2 Mon Sep 17 00:00:00 2001 From: Michael Gallagher Date: Fri, 24 Oct 2025 14:55:05 -0700 Subject: [PATCH 03/11] Change FieldDropdown generatedOptions_ to generatedOptions https://github.com/google/blockly/commit/c458d63018dc9ac63355c3c7c634869b86125abb#diff-af2458fcf0c5427418a18bfcc195a5f27fb6177b212fdc523f31c077819035f1L75-R75 https://github.com/google/blockly/blob/blockly-v11.2.2/core/field_dropdown.ts#L403 --- .../src/fields/field_lexical_variable.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block-lexical-variables/src/fields/field_lexical_variable.js b/block-lexical-variables/src/fields/field_lexical_variable.js index 77714fe..d8eabd9 100644 --- a/block-lexical-variables/src/fields/field_lexical_variable.js +++ b/block-lexical-variables/src/fields/field_lexical_variable.js @@ -422,12 +422,12 @@ FieldLexicalVariable.prototype.getOptions = function(opt_useCache, } const extraOption = opt_extraOption || []; if (this.isOptionListDynamic()) { - if (!this.generatedOptions_ || !opt_useCache) { - this.generatedOptions_ = + if (!this.generatedOptions || !opt_useCache) { + this.generatedOptions = this.menuGenerator_.call(this).concat(extraOption); - validateOptions(this.generatedOptions_); + validateOptions(this.generatedOptions); } - return this.generatedOptions_.concat(extraOption); + return this.generatedOptions.concat(extraOption); } return /** @type {!Array>} */ (this.menuGenerator_); }; From 7c5953616e4dc5d0b37b5240beb11a52dc8e62ba Mon Sep 17 00:00:00 2001 From: Michael Gallagher Date: Fri, 24 Oct 2025 15:08:55 -0700 Subject: [PATCH 04/11] Change FieldDropdown menuGenerator_() to getOptions() https://github.com/google/blockly/blob/blockly-v11.2.2/core/field_dropdown.ts#L403 --- block-lexical-variables/src/warningHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block-lexical-variables/src/warningHandler.js b/block-lexical-variables/src/warningHandler.js index be6d585..c27f212 100644 --- a/block-lexical-variables/src/warningHandler.js +++ b/block-lexical-variables/src/warningHandler.js @@ -123,7 +123,7 @@ export class ErrorCheckers { for (let i=0; i Date: Fri, 24 Oct 2025 15:24:51 -0700 Subject: [PATCH 05/11] Change FieldInput onHtmlInputChange_ to onHtmlInputChange https://github.com/google/blockly/commit/61bbd7dbf6de1306986389a72f7a14fd7641b9ba#diff-6e809b7c830fc095183f413ca9bf0b89fdaeaffa92c189d758597b368ff1b1a1L577-R577 --- block-lexical-variables/src/blocks/procedures.js | 4 ++-- block-lexical-variables/src/fields/field_flydown.js | 2 +- block-lexical-variables/src/fields/field_procedurename.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/block-lexical-variables/src/blocks/procedures.js b/block-lexical-variables/src/blocks/procedures.js index 41c738f..dcc7e5f 100644 --- a/block-lexical-variables/src/blocks/procedures.js +++ b/block-lexical-variables/src/blocks/procedures.js @@ -643,9 +643,9 @@ Blockly.Blocks['procedures_mutatorarg'] = { LexicalVariable.renameParam); // 2017 Blockly's text input change breaks our renaming behavior. // The following is a version we've defined. - editor.onHtmlInputChange_ = function(e) { + editor.onHtmlInputChange = function(e) { const oldValue = this.getValue(); - FieldFlydown.prototype.onHtmlInputChange_.call(this, e); + FieldFlydown.prototype.onHtmlInputChange.call(this, e); const newValue = this.getValue(); if (newValue && oldValue !== newValue && Blockly.Events.isEnabled()) { Blockly.Events.fire( diff --git a/block-lexical-variables/src/fields/field_flydown.js b/block-lexical-variables/src/fields/field_flydown.js index 2557b21..04a921b 100644 --- a/block-lexical-variables/src/fields/field_flydown.js +++ b/block-lexical-variables/src/fields/field_flydown.js @@ -250,7 +250,7 @@ function callAllValidators(field, text) { // Override Blockly's behavior; they call the validator after setting the text, // which is incompatible with how our validators work (we expect to be called // before the change since in order to find the old references to be renamed). -FieldFlydown.prototype.onHtmlInputChange_ = function(e) { +FieldFlydown.prototype.onHtmlInputChange = function(e) { const htmlInput = this.htmlInput_; const text = htmlInput.value; if (text !== htmlInput.oldValue_) { diff --git a/block-lexical-variables/src/fields/field_procedurename.js b/block-lexical-variables/src/fields/field_procedurename.js index 2a725df..e9bd4b8 100644 --- a/block-lexical-variables/src/fields/field_procedurename.js +++ b/block-lexical-variables/src/fields/field_procedurename.js @@ -58,13 +58,13 @@ export class FieldProcedureName extends Blockly.FieldTextInput { } /* -FieldProcedureName.prototype.onHtmlInputChange_ = function(e) { +FieldProcedureName.prototype.onHtmlInputChange = function(e) { if (e.type == 'keypress') { console.log('Suppressed keypress event'); return; // suppress change handling on key press } console.log("input's value is " + Blockly.FieldTextInput.htmlInput_.value); - FieldProcedureName.superClass_.onHtmlInputChange_.call(this, e); + FieldProcedureName.superClass_.onHtmlInputChange.call(this, e); }; */ From 838955afce6491cbed073790b2b4bf539e4a442a Mon Sep 17 00:00:00 2001 From: Michael Gallagher Date: Fri, 24 Oct 2025 15:32:49 -0700 Subject: [PATCH 06/11] Change MutatorIcon rootBlock_ to rootBlock https://github.com/google/blockly/commit/f95af3614c7d1e787a8c5b3cfbf3776553fdd133#diff-7eb8337e1180eb397247bb8e8f91ac5f1d94e06d6518261ff71d28f664b0bef9L66-R66 --- block-lexical-variables/src/blocks/lexical-variables.js | 4 ++-- block-lexical-variables/src/blocks/procedures.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block-lexical-variables/src/blocks/lexical-variables.js b/block-lexical-variables/src/blocks/lexical-variables.js index dfa6904..de00b6b 100644 --- a/block-lexical-variables/src/blocks/lexical-variables.js +++ b/block-lexical-variables/src/blocks/lexical-variables.js @@ -457,10 +457,10 @@ Blockly.Blocks['local_declaration_statement'] = { newLocals[paramIndex] = newParamName; // If there's an open mutator, change the name in the corresponding slot. - if (localDecl.mutator && localDecl.mutator.rootBlock_) { + if (localDecl.mutator && localDecl.mutator.rootBlock) { // Iterate through mutatorarg param blocks and change name of one at // paramIndex - const mutatorContainer = localDecl.mutator.rootBlock_; + const mutatorContainer = localDecl.mutator.rootBlock; let mutatorargIndex = 0; let mutatorarg = mutatorContainer.getInputTargetBlock('STACK'); while (mutatorarg && mutatorargIndex < paramIndex) { diff --git a/block-lexical-variables/src/blocks/procedures.js b/block-lexical-variables/src/blocks/procedures.js index dcc7e5f..37f4ff0 100644 --- a/block-lexical-variables/src/blocks/procedures.js +++ b/block-lexical-variables/src/blocks/procedures.js @@ -291,10 +291,10 @@ Blockly.Blocks['procedures_defnoreturn'] = { // 2. If there's an open mutator, change the name in the corresponding // slot. - if (procDecl.mutator && procDecl.mutator.rootBlock_) { + if (procDecl.mutator && procDecl.mutator.rootBlock) { // Iterate through mutatorarg param blocks and change name of one at // paramIndex - const mutatorContainer = procDecl.mutator.rootBlock_; + const mutatorContainer = procDecl.mutator.rootBlock; let mutatorargIndex = 0; let mutatorarg = mutatorContainer.getInputTargetBlock('STACK'); while (mutatorarg && mutatorargIndex < paramIndex) { From 08c99b6b82afddc7cd1cf36cf682fcffe9bb865c Mon Sep 17 00:00:00 2001 From: Michael Gallagher Date: Fri, 24 Oct 2025 15:38:24 -0700 Subject: [PATCH 07/11] Change Connection sourceBlock_ to getSourceBlock() https://github.com/google/blockly/blob/blockly-v11.2.2/core/connection.ts#L177 --- block-lexical-variables/src/blocks/procedures.js | 2 +- block-lexical-variables/src/utilities.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block-lexical-variables/src/blocks/procedures.js b/block-lexical-variables/src/blocks/procedures.js index 37f4ff0..f8c28fa 100644 --- a/block-lexical-variables/src/blocks/procedures.js +++ b/block-lexical-variables/src/blocks/procedures.js @@ -887,7 +887,7 @@ Blockly.Blocks['procedures_callnoreturn'] = { if (quarkName in this.quarkConnections_) { connection = this.quarkConnections_[quarkName]; if (!connection || connection.targetConnection || - connection.sourceBlock_.workspace != this.workspace) { + connection.getSourceBlock().workspace != this.workspace) { // Block no longer exists or has been attached elsewhere. delete this.quarkConnections_[quarkName]; } else { diff --git a/block-lexical-variables/src/utilities.js b/block-lexical-variables/src/utilities.js index d17b146..d0c6afc 100644 --- a/block-lexical-variables/src/utilities.js +++ b/block-lexical-variables/src/utilities.js @@ -22,10 +22,10 @@ import './msg.js'; * @return {boolean} */ export const InstantInTime = function(myConn, otherConn) { - if (!myConn.sourceBlock_.rendered || - !otherConn.sourceBlock_.rendered) { + if (!myConn.getSourceBlock().rendered || + !otherConn.getSourceBlock().rendered) { if (otherConn.getCheck() && !otherConn.getCheck().includes('InstantInTime')) { - otherConn.sourceBlock_.badBlock(); + otherConn.getSourceBlock().badBlock(); } return true; } From 0f6852618ffc87ec03af84e67413df2695f843af Mon Sep 17 00:00:00 2001 From: Michael Gallagher Date: Fri, 24 Oct 2025 15:42:31 -0700 Subject: [PATCH 08/11] Change Field sourceBlock_ to getSourceBlock() https://github.com/google/blockly/blob/blockly-v11.2.2/core/field.ts#L291 --- .../src/blocks/procedures.js | 2 +- .../src/fields/field_flydown.js | 8 ++--- .../src/fields/field_lexical_variable.js | 30 +++++++++---------- .../src/fields/field_procedurename.js | 12 ++++---- .../src/procedure_utils.js | 6 ++-- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/block-lexical-variables/src/blocks/procedures.js b/block-lexical-variables/src/blocks/procedures.js index f8c28fa..086fb2e 100644 --- a/block-lexical-variables/src/blocks/procedures.js +++ b/block-lexical-variables/src/blocks/procedures.js @@ -649,7 +649,7 @@ Blockly.Blocks['procedures_mutatorarg'] = { const newValue = this.getValue(); if (newValue && oldValue !== newValue && Blockly.Events.isEnabled()) { Blockly.Events.fire( - new Blockly.Events.BlockChange(this.sourceBlock_, 'field', this.name, + new Blockly.Events.BlockChange(this.getSourceBlock(), 'field', this.name, oldValue, newValue)); } }; diff --git a/block-lexical-variables/src/fields/field_flydown.js b/block-lexical-variables/src/fields/field_flydown.js index 04a921b..da88829 100644 --- a/block-lexical-variables/src/fields/field_flydown.js +++ b/block-lexical-variables/src/fields/field_flydown.js @@ -123,7 +123,7 @@ FieldFlydown.prototype.flyoutCSSClassName = FieldFlydown.prototype.onMouseOver_ = function(e) { // [lyn, 10/22/13] No flydowns in a flyout! - if (!this.sourceBlock_.isInFlyout && FieldFlydown.showPid_ == 0) { + if (!this.getSourceBlock().isInFlyout && FieldFlydown.showPid_ == 0) { FieldFlydown.showPid_ = window.setTimeout(this.showFlydownMaker_(), FieldFlydown.timeout); @@ -256,7 +256,7 @@ FieldFlydown.prototype.onHtmlInputChange = function(e) { if (text !== htmlInput.oldValue_) { htmlInput.oldValue_ = text; let valid = true; - if (this.sourceBlock_) { + if (this.getSourceBlock()) { valid = callAllValidators(this, htmlInput.value); } if (valid === null) { @@ -268,7 +268,7 @@ FieldFlydown.prototype.onHtmlInputChange = function(e) { } else if (Blockly.utils.userAgent.WEBKIT) { // Cursor key. Render the source block to show the caret moving. // Chrome only (version 26, OS X). - this.sourceBlock_.render(); + this.getSourceBlock().render(); } // We need all of the following to cause the field to resize! @@ -276,7 +276,7 @@ FieldFlydown.prototype.onHtmlInputChange = function(e) { this.forceRerender(); this.resizeEditor_(); - Blockly.svgResize(this.sourceBlock_.workspace); + Blockly.svgResize(this.getSourceBlock().workspace); }; /** diff --git a/block-lexical-variables/src/fields/field_lexical_variable.js b/block-lexical-variables/src/fields/field_lexical_variable.js index d8eabd9..613ba4e 100644 --- a/block-lexical-variables/src/fields/field_lexical_variable.js +++ b/block-lexical-variables/src/fields/field_lexical_variable.js @@ -191,7 +191,7 @@ FieldLexicalVariable.getGlobalNames = function(optExcludedBlock) { // Shared.showPrefixToUser is true, non-global names are prefixed with labels // specified in blocklyeditor.js FieldLexicalVariable.prototype.getNamesInScope = function() { - return FieldLexicalVariable.getNamesInScope(this.sourceBlock_); + return FieldLexicalVariable.getNamesInScope(this.getSourceBlock()); }; /** @@ -372,15 +372,15 @@ FieldLexicalVariable.prototype.doValueUpdate_ = function(newValue) { */ FieldLexicalVariable.prototype.updateMutation = function() { const text = this.getText(); - if (this.sourceBlock_ && this.sourceBlock_.getParent()) { - this.sourceBlock_.eventparam = undefined; + if (this.getSourceBlock() && this.getSourceBlock().getParent()) { + this.getSourceBlock().eventparam = undefined; if (text.indexOf(Blockly.Msg.LANG_VARIABLES_GLOBAL_PREFIX + ' ') === 0) { - this.sourceBlock_.eventparam = null; + this.getSourceBlock().eventparam = null; this.translatedName = undefined; this.varname = undefined; return; } - let i, parent = this.sourceBlock_.getParent(); + let i, parent = this.getSourceBlock().getParent(); while (parent) { const variables = parent.declaredVariables ? parent.declaredVariables() : []; for (i = 0; i < variables.length; i++) { @@ -388,13 +388,13 @@ FieldLexicalVariable.prototype.updateMutation = function() { if (parent.type == 'component_event') { // Innermost scope is an event block, so eventparam can be set. const codeName = parent.getParameters()[i].name; - this.sourceBlock_.eventparam = codeName; + this.getSourceBlock().eventparam = codeName; this.translatedName = variables[i]; this.varname = codeName; return; } else { // Innermost scope is not an event, so eventparam can be nulled. - this.sourceBlock_.eventparam = null; + this.getSourceBlock().eventparam = null; this.translatedName = undefined; this.varname = undefined; return; @@ -488,9 +488,9 @@ const validateOptions = function(options) { FieldLexicalVariable.dropdownChange = function(text) { if (text) { this.doValueUpdate_(text); - const topWorkspace = this.sourceBlock_.workspace.getTopWorkspace(); + const topWorkspace = this.getSourceBlock().workspace.getTopWorkspace(); if (topWorkspace.getWarningHandler) { - topWorkspace.getWarningHandler().checkErrors(this.sourceBlock_); + topWorkspace.getWarningHandler().checkErrors(this.getSourceBlock()); } } // window.setTimeout(Blockly.Variables.refreshFlyoutCategory, 1); @@ -610,13 +610,13 @@ LexicalVariable.renameGlobal = function(newName) { // [lyn, 10/27/13] now check legality of identifiers newName = LexicalVariable.makeLegalIdentifier(newName); - this.sourceBlock_.getField('NAME').doValueUpdate_(newName); + this.getSourceBlock().getField('NAME').doValueUpdate_(newName); - const globals = FieldLexicalVariable.getGlobalNames(this.sourceBlock_); - // this.sourceBlock excludes block being renamed from consideration + const globals = FieldLexicalVariable.getGlobalNames(this.getSourceBlock()); + // this.getSourceBlock excludes block being renamed from consideration // Potentially rename declaration against other occurrences newName = FieldLexicalVariable.nameNotIn(newName, globals); - if (this.sourceBlock_.rendered) { + if (this.getSourceBlock().rendered) { // Rename getters and setters if (Blockly.common.getMainWorkspace()) { const blocks = Blockly.common.getMainWorkspace().getAllBlocks(); @@ -675,10 +675,10 @@ LexicalVariable.renameParam = function(newName) { // Default behavior consistent with previous behavior is to use "false" for // last argument -- I.e., will not rename inner declarations, but may rename // newName - return LexicalVariable.renameParamFromTo(this.sourceBlock_, oldName, + return LexicalVariable.renameParamFromTo(this.getSourceBlock(), oldName, newName, false); // Default should be false (as above), but can also play with true: - // return LexicalVariable.renameParamFromTo(this.sourceBlock_, + // return LexicalVariable.renameParamFromTo(this.getSourceBlock(), // oldName, newName, true); }; diff --git a/block-lexical-variables/src/fields/field_procedurename.js b/block-lexical-variables/src/fields/field_procedurename.js index e9bd4b8..27b3bc5 100644 --- a/block-lexical-variables/src/fields/field_procedurename.js +++ b/block-lexical-variables/src/fields/field_procedurename.js @@ -37,18 +37,18 @@ export class FieldProcedureName extends Blockly.FieldTextInput { this.oldName_ = oldValue; this.doValueUpdate_(newValue); super.setValue(newValue); - if (this.sourceBlock_ && this.sourceBlock_.isInFlyout) { + if (this.getSourceBlock() && this.getSourceBlock().isInFlyout) { // Do not take action for blocks in flyouts return; } newValue = this.getValue(); - if (typeof newValue === 'string' && this.sourceBlock_) { - const procDb = this.sourceBlock_.workspace.getProcedureDatabase(); + if (typeof newValue === 'string' && this.getSourceBlock()) { + const procDb = this.getSourceBlock().workspace.getProcedureDatabase(); if (procDb) { - if (procDb.getProcedure(this.sourceBlock_.id)) { - procDb.renameProcedure(this.sourceBlock_.id, oldValue, newValue); + if (procDb.getProcedure(this.getSourceBlock().id)) { + procDb.renameProcedure(this.getSourceBlock().id, oldValue, newValue); } else { - procDb.addProcedure(newValue, this.sourceBlock_); + procDb.addProcedure(newValue, this.getSourceBlock()); } } } diff --git a/block-lexical-variables/src/procedure_utils.js b/block-lexical-variables/src/procedure_utils.js index 7c5d174..0ddb4e4 100644 --- a/block-lexical-variables/src/procedure_utils.js +++ b/block-lexical-variables/src/procedure_utils.js @@ -136,7 +136,7 @@ export const removeProcedureValues = function(name, workspace) { * @return {string} The new, validated name of the block. */ export const renameProcedure = function(newName) { - if (this.sourceBlock_ && this.sourceBlock_.isInFlyout) { + if (this.getSourceBlock() && this.getSourceBlock().isInFlyout) { // Do not rename procedures in flyouts return newName; } @@ -149,7 +149,7 @@ export const renameProcedure = function(newName) { // [lyn, 10/28/13] Prevent two procedures from having the same name. const procBlocks = getAllProcedureDeclarationBlocksExcept( - this.sourceBlock_); + this.getSourceBlock()); const procNames = procBlocks.map(function(decl) { return decl.getFieldValue('NAME'); }); @@ -158,7 +158,7 @@ export const renameProcedure = function(newName) { this.doValueUpdate_(newName); } // Rename any callers. - const blocks = this.sourceBlock_.workspace.getAllBlocks(); + const blocks = this.getSourceBlock().workspace.getAllBlocks(); for (let x = 0; x < blocks.length; x++) { const func = blocks[x].renameProcedure; if (func) { From 2785f1891bb9964b92bf031c7863cbdd914ce05d Mon Sep 17 00:00:00 2001 From: Michael Gallagher Date: Fri, 24 Oct 2025 15:52:31 -0700 Subject: [PATCH 09/11] Change WorkspaceSvg toolbox_ to getToolbox() https://github.com/google/blockly/commit/61bbd7dbf6de1306986389a72f7a14fd7641b9ba#diff-5175ae7b6cd103f9910b04fab3e7c4b2007b60078a396af66e63a6e8c63e6aceL209-R212 https://github.com/google/blockly/blob/blockly-v11.2.2/core/workspace_svg.ts#L1009 --- block-lexical-variables/src/fields/flydown.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block-lexical-variables/src/fields/flydown.js b/block-lexical-variables/src/fields/flydown.js index 7d8f699..a2707ff 100644 --- a/block-lexical-variables/src/fields/flydown.js +++ b/block-lexical-variables/src/fields/flydown.js @@ -234,9 +234,9 @@ Flydown.prototype.placeNewBlock_ = function(originBlock) { xyNew.y += targetWorkspace.scrollY / targetWorkspace.scale - targetWorkspace.scrollY; // If the flyout is collapsible and the workspace can't be scrolled. - if (targetWorkspace.toolbox_ && !targetWorkspace.scrollbar) { - xyNew.x += targetWorkspace.toolbox_.getWidth() / targetWorkspace.scale; - xyNew.y += targetWorkspace.toolbox_.getHeight() / targetWorkspace.scale; + if (targetWorkspace.getToolbox() && !targetWorkspace.scrollbar) { + xyNew.x += targetWorkspace.getToolbox().getWidth() / targetWorkspace.scale; + xyNew.y += targetWorkspace.getToolbox().getHeight() / targetWorkspace.scale; } // Move the new block to where the old block is. From 803b8e2234013cd580b0eac41af74b66702cd439 Mon Sep 17 00:00:00 2001 From: Michael Gallagher Date: Fri, 24 Oct 2025 15:58:03 -0700 Subject: [PATCH 10/11] Change Mutator workspace_ to getWorkspace() https://github.com/google/blockly/commit/2f74ce822f900ce7392c4979ef5551e57f6a92eb#diff-7eb8337e1180eb397247bb8e8f91ac5f1d94e06d6518261ff71d28f664b0bef9L48 https://github.com/google/blockly/commit/2f74ce822f900ce7392c4979ef5551e57f6a92eb#diff-aeb28553e3f549c3f6fcdeb09b161c70732f73df152f7e7dccd36fe535fc49f0R311 --- block-lexical-variables/src/blocks/lexical-variables.js | 2 +- block-lexical-variables/src/blocks/procedures.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/block-lexical-variables/src/blocks/lexical-variables.js b/block-lexical-variables/src/blocks/lexical-variables.js index de00b6b..84616a4 100644 --- a/block-lexical-variables/src/blocks/lexical-variables.js +++ b/block-lexical-variables/src/blocks/lexical-variables.js @@ -585,7 +585,7 @@ Blockly.Blocks['local_declaration_statement'] = { this.updateDeclarationInputs_(renamedLocalNames, initializerConnections); // Update the mutator's variables if the mutator is open. if (this.mutator && this.mutator.isVisible()) { - const blocks = this.mutator.workspace_.getAllBlocks(); + const blocks = this.mutator.getWorkspace().getAllBlocks(); for (let x = 0, block; block = blocks[x]; x++) { if (block.type == 'procedures_mutatorarg') { const oldName = block.getFieldValue('NAME'); diff --git a/block-lexical-variables/src/blocks/procedures.js b/block-lexical-variables/src/blocks/procedures.js index 086fb2e..a1d7eb7 100644 --- a/block-lexical-variables/src/blocks/procedures.js +++ b/block-lexical-variables/src/blocks/procedures.js @@ -470,7 +470,7 @@ Blockly.Blocks['procedures_defnoreturn'] = { this.updateParams_(newParams); // Update the mutator's variables if the mutator is open. if (this.mutator.isVisible()) { - const blocks = this.mutator.workspace_.getAllBlocks(); + const blocks = this.mutator.getWorkspace().getAllBlocks(); for (let x = 0, block; block = blocks[x]; x++) { if (block.type == 'procedures_mutatorarg') { const oldName = block.getFieldValue('NAME'); From a6173a4081b2e78c552127fa74eb30af246465dd Mon Sep 17 00:00:00 2001 From: Michael Gallagher Date: Fri, 24 Oct 2025 16:19:14 -0700 Subject: [PATCH 11/11] Remove outdated comment --- block-lexical-variables/src/procedure_utils.js | 1 - 1 file changed, 1 deletion(-) diff --git a/block-lexical-variables/src/procedure_utils.js b/block-lexical-variables/src/procedure_utils.js index 0ddb4e4..2a493e5 100644 --- a/block-lexical-variables/src/procedure_utils.js +++ b/block-lexical-variables/src/procedure_utils.js @@ -23,7 +23,6 @@ const procDefaultValue = ['', '']; export const onChange = function(procedureId) { let workspace = this.block.workspace.getTopWorkspace(); - // [lyn, 10/14/13] .editable is undefined on blocks. Changed to .editable_ if (!this.block.isEditable()) { return; }