You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed a parse error when parsing an object literal containing an arrow function if any properties are defined after the arrow function.
({f: x=>x})// no error({x: null,f: x=>x})// no error({f: (x=>x),x: null})// no error({x: true ? 1 : 0,y: null})// no error({f: x=>x,x: null})// ColonToken {tokenSpan = TokenPn 163 9 16, tokenComment = []}
Since the third example parses without error, my suspicion is that the, in the failing example is being parsed as a comma operator and thus the colon after x is unexpected.
The behavior also appears to be restricted to arrow functions as the fourth example contains an expression which doesn't cause a failure.
The text was updated successfully, but these errors were encountered:
I noticed a parse error when parsing an object literal containing an arrow function if any properties are defined after the arrow function.
Since the third example parses without error, my suspicion is that the
,
in the failing example is being parsed as a comma operator and thus the colon afterx
is unexpected.The behavior also appears to be restricted to arrow functions as the fourth example contains an expression which doesn't cause a failure.
The text was updated successfully, but these errors were encountered: