Advanced compilation fixes (#3995)

* Advanced compilation fixes
This commit is contained in:
Sam El-Husseini
2020-06-25 11:59:03 -07:00
committed by GitHub
parent b17cb270a1
commit 9e7f3b07e9
7 changed files with 9 additions and 9 deletions

View File

@@ -994,7 +994,6 @@ Blockly.Block.prototype.getField = function(name) {
/**
* Return all variables referenced by this block.
* @return {!Array.<string>} List of variable names.
* @package
*/
Blockly.Block.prototype.getVars = function() {
var vars = [];

View File

@@ -532,7 +532,7 @@ Blockly.Flyout.prototype.createFlyoutInfo_ = function(parsedContent) {
this.permanentlyDisabled_.length = 0;
var defaultGap = this.horizontalLayout ? this.GAP_X : this.GAP_Y;
for (var i = 0, contentInfo; (contentInfo = parsedContent[i]); i++) {
switch (contentInfo.kind.toUpperCase()) {
switch (contentInfo['kind'].toUpperCase()) {
case 'BLOCK':
var blockInfo = /** @type {Blockly.utils.toolbox.Block} */ (contentInfo);
var blockXml = this.getBlockXml_(blockInfo);

View File

@@ -168,9 +168,9 @@ Blockly.Options = function(options) {
/**
* The SVG element for the grid pattern.
* Created during injection.
* @type {!SVGElement}
* @type {SVGElement}
*/
this.gridPattern = undefined;
this.gridPattern = null;
/**
* The parent of the current workspace, or null if there is no parent

View File

@@ -123,7 +123,7 @@ Blockly.registry.register = function(type, name, registryItem) {
Blockly.registry.validate_ = function(type, registryItem) {
switch (type) {
case String(Blockly.registry.Type.FIELD):
if (typeof registryItem['fromJson'] != 'function') {
if (typeof registryItem.fromJson != 'function') {
throw Error('Type "' + type + '" must have a fromJson function');
}
break;

View File

@@ -275,7 +275,7 @@ Blockly.Toolbox.prototype.createTree_ = function(toolboxDef, treeOut) {
}
for (var i = 0, childIn; (childIn = toolboxDef[i]); i++) {
switch (childIn.kind.toUpperCase()) {
switch (childIn['kind'].toUpperCase()) {
case 'CATEGORY':
var categoryInfo = /** @type {Blockly.utils.toolbox.Category} */ (childIn);
openNode = this.addCategory_(categoryInfo, treeOut) || openNode;
@@ -324,7 +324,7 @@ Blockly.Toolbox.prototype.addCategory_ = function(categoryInfo, treeOut) {
// Variables and procedures are special dynamic categories.
childOut.contents = custom;
} else {
openNode = this.createTree_(categoryInfo.contents, childOut) || openNode;
openNode = this.createTree_(categoryInfo['contents'], childOut) || openNode;
}
this.setColourOrStyle_(categoryInfo, childOut, categoryName);
openNode = this.setExpanded_(categoryInfo, childOut) || openNode;
@@ -369,7 +369,7 @@ Blockly.Toolbox.prototype.setColourOrStyle_ = function(
*/
Blockly.Toolbox.prototype.addSeparator_ = function(
separatorInfo, treeOut, lastElement) {
if (lastElement && lastElement.kind.toUpperCase() == 'CATEGORY') {
if (lastElement && lastElement['kind'].toUpperCase() == 'CATEGORY') {
// Separator between two categories.
// <sep></sep>
treeOut.add(new Blockly.Toolbox.TreeSeparator(

View File

@@ -102,7 +102,7 @@ Blockly.WorkspaceSvg = function(options,
* @private
*/
this.grid_ = this.options.gridPattern ?
new Blockly.Grid(options.gridPattern, options.gridOptions) : null;
new Blockly.Grid(this.options.gridPattern, options.gridOptions) : null;
/**
* Manager in charge of markers and cursors.

View File

@@ -75,6 +75,7 @@ done
echo "Compiling Blockly..."
COMPILATION_COMMAND="java -jar $COMPILER --js='$BLOCKLY_ROOT/tests/compile/main.js' \
--js='$tempPath/**.js' \
--js='$BLOCKLY_ROOT/tests/blocks/**.js' \
--js='$BLOCKLY_ROOT/blocks/**.js' \
--js='$BLOCKLY_ROOT/generators/**.js' \
--generate_exports \