Prevent collisions between user functions and helper functions.

This commit is contained in:
Neil Fraser
2016-06-12 12:19:08 -07:00
parent 97000e725f
commit 477562b597
8 changed files with 21 additions and 16 deletions

View File

@@ -58,7 +58,8 @@ Blockly.Lua['procedures_defreturn'] = function(block) {
var code = 'function ' + funcName + '(' + args.join(', ') + ')\n' +
branch + returnValue + 'end\n';
code = Blockly.Lua.scrub_(block, code);
Blockly.Lua.definitions_[funcName] = code;
// Add % so as not to collide with helper functions in definitions list.
Blockly.Lua.definitions_['%' + funcName] = code;
return null;
};