Open Fee0 opened 7 months ago
moved some parsing code to extra functions to avoid duplicated code in case of parsing as optional or without optional operator
found some code that does not parse correctly:
function a(t){
return 'normal' === t?.123:'fast' === t?.321:t
}
it seems this is a ternary operator + specification of a floating point number without the leading zero, which gets interpreted as the optional chaining operator now.
I wonder if we have to look ahead now for the matching ":" and then decide if its ternary or optional chaining operator.
Good catch! I think we we might be able to get away with a check that the character after ?. is an ident_start. I can try and play around with that in ress this weekend
Ah, I thought its actually from my RESSA code. I gave it a try to fix this: https://github.com/rusty-ecma/RESS/pull/101
for normal indexing, computed indexing and function calls