Skip to content

Commit

Permalink
Merge branch 'issue1011' of http://github.com/michaelficarra/coffee-s…
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Jan 11, 2011
2 parents 9b3197c + b158f1c commit 47e4f4d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/nodes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/nodes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ exports.Call = class Call extends Base
fun = "(#{ref} = #{ base.compile o, LEVEL_LIST })#{ name.compile o }"
else
fun = base.compile o, LEVEL_ACCESS
fun = "(#{fun})" if SIMPLENUM.test fun
if name
ref = fun
fun += name.compile o
Expand Down
8 changes: 7 additions & 1 deletion test/function_invocation.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ ok pen is 2
method 1, 2
ok pen is 2

# Finally, splats with super() within classes.
# splats with super() within classes.
class Parent
meth: (args...) ->
args
Expand All @@ -308,6 +308,12 @@ class Child extends Parent
super nums...
ok (new Child).meth().join(' ') is '3 2 1'

test "#1011: passing a splat to a method of a number", ->
eq '1011', 11.toString [2]...
eq '1011', (31).toString [3]...
eq '1011', 69.0.toString [4]...
eq '1011', (131.0).toString [5]...


#### Implicit Return

Expand Down

0 comments on commit 47e4f4d

Please sign in to comment.