merging stable

This commit is contained in:
Jeremy Ashkenas
2011-03-12 07:41:58 -06:00
4 changed files with 23 additions and 12 deletions

View File

@@ -37,18 +37,6 @@ test "array splat expansions with assignments", ->
arrayEq [0,1,2,3,4], list
test "array splats with nested arrays", ->
nonce = {}
a = [nonce]
list = [1, 2, a...]
eq list[0], 1
eq list[2], nonce
a = [[nonce]]
list = [1, 2, a...]
arrayEq list, [1, 2, [nonce]]
test "mixed shorthand objects in array lists", ->
arr = [
@@ -69,3 +57,16 @@ test "mixed shorthand objects in array lists", ->
eq arr.length, 4
eq arr[2].b, 1
eq arr[3], 'b'
test "array splats with nested arrays", ->
nonce = {}
a = [nonce]
list = [1, 2, a...]
eq list[0], 1
eq list[2], nonce
a = [[nonce]]
list = [1, 2, a...]
arrayEq list, [1, 2, [nonce]]

View File

@@ -339,6 +339,12 @@ test "passing splats to functions", ->
arrayEq [2..6], others
eq 7, last
test "splat variables are local to the function", ->
outer = "x"
clobber = (avar, outer...) -> outer
clobber "foo", "bar"
eq "x", outer
test "Issue 894: Splatting against constructor-chained functions.", ->