Fix #4576: Allow accessing a property of a function literal (like `.call`) via chaining syntax (#4665)
This commit is contained in:
parent
eb38dba5d6
commit
d7d69a4a18
|
@ -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
|
@ -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'
|
||||
]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue