mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Create block id database.
This commit is contained in:
parent
b2bbde04a1
commit
3b3ef79fbd
9 changed files with 84 additions and 70 deletions
|
@ -202,6 +202,8 @@ Blockly.Generator.prototype.valueToCode = function(block, name, order) {
|
|||
}
|
||||
// Value blocks must return code and order of operations info.
|
||||
// Statement blocks must only return code.
|
||||
goog.asserts.assertArray(tuple, 'Expecting tuple from value block "%s".',
|
||||
targetBlock.type);
|
||||
var code = tuple[0];
|
||||
var innerOrder = tuple[1];
|
||||
if (isNaN(innerOrder)) {
|
||||
|
@ -237,6 +239,7 @@ Blockly.Generator.prototype.statementToCode = function(block, name) {
|
|||
var code = this.blockToCode(targetBlock);
|
||||
// Value blocks must return code and order of operations info.
|
||||
// Statement blocks must only return code.
|
||||
goog.asserts.assertString(code, 'Expecting code from statement block "%s".',
|
||||
targetBlock && targetBlock.type);
|
||||
if (code) {
|
||||
code = this.prefixLines(/** @type {string} */ (code), this.INDENT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue