mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
adding support for calling variadic functions with less than the requested number of arguments.
This commit is contained in:
@@ -89,4 +89,19 @@ class Child extends Parent
|
||||
nums: [3, 2, 1]
|
||||
super nums...
|
||||
|
||||
ok (new Child()).meth().join(' ') is '3 2 1'
|
||||
ok (new Child()).meth().join(' ') is '3 2 1'
|
||||
|
||||
|
||||
# Functions with splats being called with too few arguments.
|
||||
pen: null
|
||||
method: (first, variable..., penultimate, ultimate) ->
|
||||
pen: penultimate
|
||||
|
||||
method 1, 2, 3, 4, 5, 6, 7, 8, 9
|
||||
ok pen is 8
|
||||
|
||||
method 1, 2, 3
|
||||
ok pen is 2
|
||||
|
||||
method 1, 2
|
||||
ok pen is 2
|
||||
|
||||
Reference in New Issue
Block a user