invalid destructuring assignments like {0} = x now causes syntax error

This commit is contained in:
satyr
2010-10-25 04:45:31 +09:00
parent e007f69c71
commit c8d994a97d
3 changed files with 11 additions and 1 deletions

View File

@@ -59,3 +59,8 @@ val = null
val ?= 'value'
val ?= 'eulav'
eq val, 'value'
for nonident in ['""', '0']
try ok not CoffeeScript.compile "{#{nonident}} = x"
catch e then eq e.message, nonident + ' cannot be assigned.'