Fix bug: Recursion shares a single variable between all stack frames when compiling to JS
This commit is contained in:
parent
2238d363e5
commit
79deebabf4
2
ir.py
2
ir.py
|
@ -162,7 +162,7 @@ class LetBinding:
|
|||
|
||||
def codegen(self) -> str:
|
||||
rhs_cg = self.rhs.codegen_named(self.lhs) if isinstance(self.rhs, Function) else self.rhs.codegen()
|
||||
return f'({self.lhs}={rhs_cg},{self.body.codegen()})'
|
||||
return f'({self.lhs}=>{self.body.codegen()})({rhs_cg})'
|
||||
|
||||
@dataclass
|
||||
class Application:
|
||||
|
|
Loading…
Reference in a new issue