From 0aec80a08812555ceede24e15686d807404c7945 Mon Sep 17 00:00:00 2001 From: Rodrigo Queiro Date: Mon, 14 Mar 2016 15:07:30 +0100 Subject: [PATCH 1/2] Add missing comma to Lua reserved words This meant that variables could be called _, conflicting with use in Lua as a dummy variable, and in particular with scrubNakedValue. --- generators/lua.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/lua.js b/generators/lua.js index 885e77c23..a1265b669 100644 --- a/generators/lua.js +++ b/generators/lua.js @@ -45,7 +45,7 @@ Blockly.Lua = new Blockly.Generator('Lua'); */ Blockly.Lua.addReservedWords( // Special character - '_' + + '_,' + // From theoriginalbit's script: // https://github.com/espertus/blockly-lua/issues/6 '__inext,assert,bit,colors,colours,coroutine,disk,dofile,error,fs,' + From 37d3ecc304d5ddb14e4452b2f33dc5deb9a76c53 Mon Sep 17 00:00:00 2001 From: Rodrigo Queiro Date: Mon, 14 Mar 2016 15:08:49 +0100 Subject: [PATCH 2/2] Fix JSDoc syntax on Blockly.Lua.lists.getIndex_ Also fix a return type warning in one of the branches. --- generators/lua/lists.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/lua/lists.js b/generators/lua/lists.js index 91f2c9734..619f6d8d7 100644 --- a/generators/lua/lists.js +++ b/generators/lua/lists.js @@ -119,12 +119,12 @@ Blockly.Lua['lists_indexOf'] = function(block) { * @private * @param {string} listname Name of the list, used to calculate length. * @param {string} where The method of indexing, selected by dropdown in Blockly - * @param {=string} opt_at The optional offset when indexing from start/end. + * @param {string=} opt_at The optional offset when indexing from start/end. * @return {string} Index expression. */ Blockly.Lua.lists.getIndex_ = function(listname, where, opt_at) { if (where == 'FIRST') { - return 1; + return '1'; } else if (where == 'FROM_END') { return '#' + listname + ' + 1 - ' + opt_at; } else if (where == 'LAST') {