added Stan's fix for try/finally without catch

This commit is contained in:
Jeremy Ashkenas
2010-03-10 16:27:30 -05:00
parent 2a47727641
commit f2d0aee656
3 changed files with 16 additions and 2 deletions

View File

@@ -905,7 +905,7 @@ exports.TryNode: class TryNode extends BaseNode
o.top: true
attempt_part: @attempt.compile(o)
error_part: if @error then " (${ @error.compile(o) }) " else ' '
catch_part: "${ (@recovery or '') and ' catch' }$error_part{\n${ @recovery.compile(o) }\n$@tab}"
catch_part: if @recovery then " catch$error_part{\n${ @recovery.compile(o) }\n$@tab}" else ''
finally_part: (@ensure or '') and ' finally {\n' + @ensure.compile(merge(o, {returns: null})) + "\n$@tab}"
"${@tab}try {\n$attempt_part\n$@tab}$catch_part$finally_part"