Browse files

minor enhancements to tests for #1005

  • Loading branch information...
1 parent c3fe294 commit fa2fbf0c604803c05ca65ca86ffc91a23e484c63 @michaelficarra michaelficarra committed Aug 11, 2011
Showing with 5 additions and 4 deletions.
  1. +5 −4 test/assignment.coffee
View
9 test/assignment.coffee
@@ -254,11 +254,12 @@ test "#1024", ->
test "#1005: invalid identifiers allowed on LHS of destructuring assignment", ->
disallowed = ['eval', 'arguments'].concat CoffeeScript.RESERVED
- throws -> CoffeeScript.compile "[#{disallowed.join ', '}] = x"
- throws -> CoffeeScript.compile "[#{disallowed.join '..., '}...] = x"
+ throws (-> CoffeeScript.compile "[#{disallowed.join ', '}] = x"), null, 'all disallowed'
+ throws (-> CoffeeScript.compile "[#{disallowed.join '..., '}...] = x"), null, 'all disallowed as splats'
+ t = tSplat = null
for v in disallowed when v isnt 'class' # `class` by itself is an expression
- throws -> CoffeeScript.compile "[#{v}] = x"
- throws -> CoffeeScript.compile "[#{v}...] = x"
+ throws (-> CoffeeScript.compile t), null, t = "[#{v}] = x"
+ throws (-> CoffeeScript.compile tSplat), null, tSplat = "[#{v}...] = x"
doesNotThrow ->
for v in disallowed
CoffeeScript.compile "[a.#{v}] = x"

0 comments on commit fa2fbf0

Please sign in to comment.