mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-17 19:11:22 -05:00
better existence test, with tests
This commit is contained in:
@@ -724,7 +724,8 @@ module CoffeeScript
|
||||
end
|
||||
|
||||
def compile(o={})
|
||||
write("(#{@expression.compile(super(o))} != undefined)")
|
||||
val = @expression.compile(super(o))
|
||||
write("(typeof #{val} !== 'undefined' && #{val} !== null)")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user