Wrapping existence tests on functions.

This commit is contained in:
Timothy Jones
2010-08-26 09:03:10 +12:00
parent 6224edd6ce
commit 6607224493

View File

@@ -442,8 +442,8 @@ exports.CallNode = class CallNode extends BaseNode
o.chainRoot = this unless o.chainRoot o.chainRoot = this unless o.chainRoot
if @exist if @exist
[@first, @meth] = @variable.compileReference o, precompile: yes [@first, @meth] = @variable.compileReference o, precompile: yes
@first = "typeof #{@first} === \"function\" ? " @first = "(typeof #{@first} === \"function\" ? "
@last = " : null" @last = " : null)"
else if @variable then @meth = @variable.compile o else if @variable then @meth = @variable.compile o
for arg in @args when arg instanceof SplatNode for arg in @args when arg instanceof SplatNode
compilation = @compileSplat(o) compilation = @compileSplat(o)