Skip to content

Commit

Permalink
Merge pull request #448 from entrylabs/hotfix/function-schema-init
Browse files Browse the repository at this point in the history
hotfix function schema
  • Loading branch information
chanlee authored Aug 18, 2016
2 parents f4a547d + 1716d43 commit 94342fd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions dist/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -13885,6 +13885,9 @@ Entry.VariableContainer.prototype.setVariables = function(b) {
this.updateList();
};
Entry.VariableContainer.prototype.setFunctions = function(b) {
b && b.forEach(function(a) {
Entry.block["func_" + a.id] = !0;
});
for (var a in b) {
var c = new Entry.Func(b[a]);
c.generateBlock();
Expand Down
2 changes: 1 addition & 1 deletion dist/entry.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/variable_container.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,12 @@ Entry.VariableContainer.prototype.setVariables = function(variables) {
* @param {!Array.<function model>} variables
*/
Entry.VariableContainer.prototype.setFunctions = function(functions) {
if (functions) {
functions.forEach(function(f) {
Entry.block['func_' + f.id] = true;
});
}

for (var i in functions) {
var func = new Entry.Func(functions[i]);
func.generateBlock();
Expand Down
3 changes: 1 addition & 2 deletions src/workspace/thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ Entry.Thread = function(thread, code, parent) {
if (block instanceof Entry.Block || block.isDummy) {
block.setThread(this);
this._data.push(block);
} else
Entry.block[block.type] && this._data.push(new Entry.Block(block, this));
} else Entry.block[block.type] && this._data.push(new Entry.Block(block, this));
}

var codeView = this._code.view;
Expand Down

0 comments on commit 94342fd

Please sign in to comment.