tests for #1591: splatted expressions in destructuring assignment must be assignable

This commit is contained in:
Gerald Lewis 2011-08-30 11:12:39 -04:00
parent e17b67e6f2
commit 3a6c8c92b3
1 changed files with 5 additions and 0 deletions

View File

@ -301,3 +301,8 @@ test "#1348, #1216: existential assignment compilation", ->
if a then a ?= 2 else a = 3
eq a, nonce
test "#1591, #1101: splatted expressions in destructuring assignment must be assignable", ->
nonce = {}
for nonref in ['', '""', '0', 'f()', '(->)'].concat CoffeeScript.RESERVED
eq nonce, (try CoffeeScript.compile "[#{nonref}...] = v" catch e then nonce)