From 6607224493e672b190e697c25bbcdd5b1a1bd263 Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Thu, 26 Aug 2010 09:03:10 +1200 Subject: [PATCH] Wrapping existence tests on functions. --- src/nodes.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nodes.coffee b/src/nodes.coffee index 2df887f7..aa034ff3 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -442,8 +442,8 @@ exports.CallNode = class CallNode extends BaseNode o.chainRoot = this unless o.chainRoot if @exist [@first, @meth] = @variable.compileReference o, precompile: yes - @first = "typeof #{@first} === \"function\" ? " - @last = " : null" + @first = "(typeof #{@first} === \"function\" ? " + @last = " : null)" else if @variable then @meth = @variable.compile o for arg in @args when arg instanceof SplatNode compilation = @compileSplat(o)