mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
* Fix #3709: throwing an if, for, switch or while should throw the returned value of the statement/loop * Fix #3789: don’t throw a throw (unless it’s in a closure) * LEVEL_LIST works better than a list of node types
This commit is contained in:
@@ -3255,7 +3255,7 @@ exports.Throw = class Throw extends Base
|
||||
makeReturn: THIS
|
||||
|
||||
compileNode: (o) ->
|
||||
fragments = @expression.compileToFragments o
|
||||
fragments = @expression.compileToFragments o, LEVEL_LIST
|
||||
unshiftAfterComments fragments, @makeCode 'throw '
|
||||
fragments.unshift @makeCode @tab
|
||||
fragments.push @makeCode ';'
|
||||
|
||||
Reference in New Issue
Block a user