mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 03:21:20 -05:00
only let returns stop an expression from being closure-ified -- breaks and continues may be valid
This commit is contained in:
@@ -45,7 +45,7 @@ module CoffeeScript
|
|||||||
@indent = o[:indent]
|
@indent = o[:indent]
|
||||||
top = self.top_sensitive? ? @options[:top] : @options.delete(:top)
|
top = self.top_sensitive? ? @options[:top] : @options.delete(:top)
|
||||||
closure = statement? && !statement_only? && !top && !@options[:return] && !self.is_a?(CommentNode)
|
closure = statement? && !statement_only? && !top && !@options[:return] && !self.is_a?(CommentNode)
|
||||||
closure &&= !contains? {|n| n.statement_only? }
|
closure &&= !contains? {|n| n.is_a?(ReturnNode) }
|
||||||
closure ? compile_closure(@options) : compile_node(@options)
|
closure ? compile_closure(@options) : compile_node(@options)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user