adding support for calling variadic functions with less than the requested number of arguments.

This commit is contained in:
Jeremy Ashkenas
2010-05-08 12:44:54 -04:00
parent be72120311
commit 9a7420ccd0
3 changed files with 32 additions and 9 deletions

View File

@@ -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