Skip to content

Commit

Permalink
Issue #870 ... placeholders in destructuring assignment.
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Jan 31, 2011
1 parent 8b8e8a9 commit 4ce374b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/nodes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/nodes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,7 @@ exports.Assign = class Assign extends Base
{value} = this
{objects} = @variable.base
unless olen = objects.length
return false if top
code = value.compile o
return if o.level >= LEVEL_OP then "(#{code})" else code
isObject = @variable.isObject()
Expand Down Expand Up @@ -968,7 +969,7 @@ exports.Assign = class Assign extends Base
val = new Value new Literal(vvar), [new (if acc then Access else Index) idx]
assigns.push new Assign(obj, val, null, param: @param).compile o, LEVEL_TOP
assigns.push vvar unless top
code = assigns.join ', '
code = (compact assigns).join ', '
if o.level < LEVEL_LIST then code else "(#{code})"

# When compiling a conditional assignment, take care to ensure that the
Expand Down

0 comments on commit 4ce374b

Please sign in to comment.