Merging in Stephank's fix for #692.

This commit is contained in:
Jeremy Ashkenas
2010-09-18 10:36:48 -04:00
parent 72d7fe2f7a
commit 4b2d40d3b5
3 changed files with 14 additions and 9 deletions

View File

@@ -454,14 +454,15 @@ exports.CallNode = class CallNode extends BaseNode
if @exist
if @variable instanceof ValueNode and @variable.properties[@variable.properties.length - 1] instanceof AccessorNode
methodAccessor = @variable.properties.pop()
[@first, @meth] = @variable.compileReference o
@first = new ValueNode(@first, [methodAccessor]).compile o
@meth = new ValueNode(@meth, [methodAccessor]).compile o
[first, meth] = @variable.compileReference o
@first = new ValueNode(first, [methodAccessor]).compile o
@meth = new ValueNode(meth, [methodAccessor]).compile o
else
[@first, @meth] = @variable.compileReference o, precompile: yes
@first = "(typeof #{@first} === \"function\" ? "
@last = " : undefined)"
else if @variable then @meth = @variable.compile o
else if @variable
@meth = @variable.compile o
for arg in @args when arg instanceof SplatNode
code = @compileSplat(o)
if not code