Skip to content

Commit

Permalink
Rename deprecated DB property
Browse files Browse the repository at this point in the history
This was causing errors thrown when generating JS from the += block in pond-duck.

The old property uses getters and setters to deprecate to the new one, but not when compiled/renamed.  This is sadly unavoidable.
  • Loading branch information
NeilFraser committed Nov 8, 2021
1 parent 4f55acb commit 2e1caaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions appengine/js/js-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Blockly.Blocks['controls_for'].onchange = function(e) {

Blockly.JavaScript['controls_for'] = function(block) {
// For loop.
var variable = Blockly.JavaScript.variableDB_.getName(
var variable = Blockly.JavaScript.nameDB_.getName(
block.getFieldValue('VAR'), Blockly.Variables.NAME_TYPE);
var from = Blockly.JavaScript.valueToCode(block, 'FROM',
Blockly.JavaScript.ORDER_ASSIGNMENT) || '0';
Expand Down Expand Up @@ -358,7 +358,7 @@ Blockly.JavaScript['math_change'] = function(block) {
// Add to a variable in place.
var delta = Blockly.JavaScript.valueToCode(block, 'DELTA',
Blockly.JavaScript.ORDER_ADDITION) || '0';
var varName = Blockly.JavaScript.variableDB_.getName(
var varName = Blockly.JavaScript.nameDB_.getName(
block.getFieldValue('VAR'), Blockly.Variables.NAME_TYPE);
return varName + ' += ' + delta + ';\n';
};
Expand Down

0 comments on commit 2e1caaf

Please sign in to comment.