diff --git a/lib/coffee-script/rewriter.js b/lib/coffee-script/rewriter.js index f211b488..ed360e6c 100644 --- a/lib/coffee-script/rewriter.js +++ b/lib/coffee-script/rewriter.js @@ -143,9 +143,7 @@ var action, noCall; noCall = false; action = function(token, i) { - var idx; - idx = token[0] === 'OUTDENT' ? i : i; - return this.tokens.splice(idx, 0, ['CALL_END', ')', token[2]]); + return this.tokens.splice(i, 0, ['CALL_END', ')', token[2]]); }; return this.scanTokens(function(token, i, tokens) { var callObject, current, next, prev, seenControl, seenSingle, tag, _ref, _ref2, _ref3; diff --git a/src/rewriter.coffee b/src/rewriter.coffee index 5fec8eb8..33371f99 100644 --- a/src/rewriter.coffee +++ b/src/rewriter.coffee @@ -131,9 +131,7 @@ class exports.Rewriter # deal with them. addImplicitParentheses: -> noCall = no - action = (token, i) -> - idx = if token[0] is 'OUTDENT' then i else i - @tokens.splice idx, 0, ['CALL_END', ')', token[2]] + action = (token, i) -> @tokens.splice i, 0, ['CALL_END', ')', token[2]] @scanTokens (token, i, tokens) -> tag = token[0] noCall = yes if tag in ['CLASS', 'IF']