Open cqzooge opened 6 months ago
This certainly looks like a bug, we try to push a new lexical environment for the get
/set
while processing them as declarations in a type when we shouldn't.
thanks,when will this problem fixed?
by the way, what does lexicalEnvironmentSuspended
used for?
wait, why are we visiting Chile again
'cuz I'm a
forEach
chile ya hear, lord knows I'm aforEach
chile
🔎 Search Terms
Lexical environment is not suspended
🕗 Version & Regression Information
⏯ Playground Link
No response
💻 Code
🙁 Actual behavior
this code won't report error in playground, but if we parse this code and use visitEachChild to visit each node with transform context we will have crash like
the test code:
🙂 Expected behavior
don't have assert error when we visitEachChild
Additional information about the issue
seems the reason is that we set
lexicalEnvironmentSuspended
as true after visit ParameterList, and before visit FunctionBody. But if we have something between ParameterList and FunctionBody and need checklexicalEnvironmentSuspended
, we will have assert error. like get/set accessorso if we add a objectliteral type with get/set accessor as the return type of a function or method or get/set accessor, we will have crash when we use visitEachChild to visit the nodes
Is it a bug? or I use something wrong?