mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Fixes #1838
This commit is contained in:
parent
fac615108c
commit
686ef9e7f4
4 changed files with 163 additions and 152 deletions
|
@ -71,6 +71,8 @@
|
|||
Assign: [
|
||||
o('Assignable = Expression', function() {
|
||||
return new Assign($1, $3);
|
||||
}), o('Assignable = TERMINATOR Expression', function() {
|
||||
return new Assign($1, $4);
|
||||
}), o('Assignable = INDENT Expression OUTDENT', function() {
|
||||
return new Assign($1, $4);
|
||||
})
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -136,6 +136,7 @@ grammar =
|
|||
# Assignment of a variable, property, or index to a value.
|
||||
Assign: [
|
||||
o 'Assignable = Expression', -> new Assign $1, $3
|
||||
o 'Assignable = TERMINATOR Expression', -> new Assign $1, $4
|
||||
o 'Assignable = INDENT Expression OUTDENT', -> new Assign $1, $4
|
||||
]
|
||||
|
||||
|
|
|
@ -331,3 +331,9 @@ test "#1643: splatted accesses in destructuring assignments should not be declar
|
|||
unless sub is nonce and sub2 is nonce2 and sub3 is nonce3 then throw new Error('[sub...]')
|
||||
"""
|
||||
eq nonce, unless (try CoffeeScript.run code, bare: true catch e then true) then nonce
|
||||
|
||||
test "#1838: Regression with variable assignment", ->
|
||||
name =
|
||||
'dave'
|
||||
|
||||
eq name, 'dave'
|
Loading…
Reference in a new issue