mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
a touch of safety from trailing catches falling off the end of the rewriter.
This commit is contained in:
parent
a8c6a641d7
commit
f41ca2e5e8
2 changed files with 2 additions and 2 deletions
|
@ -222,7 +222,7 @@
|
|||
this.tokens.splice.apply(this.tokens, [i, 0].concat(this.indentation(token)));
|
||||
return 2;
|
||||
}
|
||||
if (token[0] === 'CATCH' && (this.tokens[i + 2][0] === 'TERMINATOR' || this.tokens[i + 2][0] === 'FINALLY')) {
|
||||
if (token[0] === 'CATCH' && (this.tag(i + 2) === 'TERMINATOR' || this.tag(i + 2) === 'FINALLY')) {
|
||||
this.tokens.splice.apply(this.tokens, [i + 2, 0].concat(this.indentation(token)));
|
||||
return 4;
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ exports.Rewriter = class Rewriter
|
|||
@tokens.splice i, 0, @indentation(token)...
|
||||
return 2
|
||||
if token[0] is 'CATCH' and
|
||||
(@tokens[i + 2][0] is 'TERMINATOR' or @tokens[i + 2][0] is 'FINALLY')
|
||||
(@tag(i + 2) is 'TERMINATOR' or @tag(i + 2) is 'FINALLY')
|
||||
@tokens.splice i + 2, 0, @indentation(token)...
|
||||
return 4
|
||||
if include(SINGLE_LINERS, token[0]) and @tag(i + 1) isnt 'INDENT' and
|
||||
|
|
Loading…
Add table
Reference in a new issue