Open jcalz opened 3 years ago
Is this a common syntactic pattern? In general we try to ignore parens in semantic analysis, but like, I wouldnβt expect a function-returning IIFE to work, so it seems like a bit of a gray area to me.
Meh, going to call it a suggestion. If thereβs evidence that this is causing confusion, Iβm open to it.
Bug Report
π Search Terms
expando, property assignments, arrow expression, #26368, #44988, #42203
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
ko
is not recognized as a function capable of having expando properties added to it, whileok
is recognized as such.π Expected behavior
Both
ok
andko
should behave the same way and allow expando properties as implemented in #26368. I don't know if it's common or not to use parentheses in this situation, but it was surprising to me when I ran into this discrepancy. I see from #44988 and #42203 that sometimes parentheses will disrupt things, so this is presumably an unanticipated use case that may not be important enough for anyone to address.