Fix #4576: Allow accessing a property of a function literal (like `.call`) via chaining syntax (#4665)

This commit is contained in:
Geoffrey Booth 2017-08-28 13:16:22 -07:00 committed by GitHub
parent eb38dba5d6
commit d7d69a4a18
4 changed files with 174 additions and 153 deletions

View File

@ -487,6 +487,10 @@
function() {
return $1.add($2);
}),
o('Code Accessor',
function() {
return new Value($1).add($2);
}),
o('ThisProperty')
],
// Everything that can be assigned to.

File diff suppressed because one or more lines are too long

View File

@ -316,6 +316,7 @@ grammar =
SimpleAssignable: [
o 'Identifier', -> new Value $1
o 'Value Accessor', -> $1.add $2
o 'Code Accessor', -> new Value($1).add $2
o 'ThisProperty'
]

View File

@ -407,3 +407,16 @@ test "#3199: throw multiline implicit object", ->
type: 'a'
msg: 'b'
eq undefined, y
test "#4576: multiple row function chaining", ->
->
eq @a, 3
.call a: 3
test "#4576: function chaining on separate rows", ->
do ->
Promise
.resolve()
.then ->
yes
.then ok