CoffeeScriptRedux
CoffeeScriptRedux copied to clipboard
Empty catch block disallowed
This is compiling fine:
try
foo
catch e
bar
baz
However, this throws a syntax error:
try
foo
catch e
# do nothing
baz
Syntax error on line 9, column 1: unexpected 'b' (\u0062)
06 : foo
07 : catch e
08 : # do nothing
09 : baz
^^ :~^
10 :
Is this a feature, or a bug?
Current workaround is to pass just about any "dummy" statement in the catch block:
try
foo
catch e
'' # do nothing
baz
try
foo
catch e
true # do nothing
baz
It's a bug.
@michaelficarra same happens to other structures too, e.g.
if condition
# TODO - to be implemented
else
return false
would throw an error at the # TODO line