on master help sign in
Fix #1104, escape labels in tail recursive functions properly
commitf2a40cccfacd38cb13faef537aed0ce985b9b767 authorEvan Czaplicki <info@elm-lang.org> dateSun 11 Oct 2015, 22:06 (11 years ago) parentec82140
1 file changed+2−2
src/Generate/JavaScript/Expression.hs+2−2
src/Generate/JavaScript/Expression.hs+2−2
@@ -164,7 +164,7 @@ generateCode expr =
164164 jsBlock $
165165 VarDeclStmt () (zipWith varDecl tempNames args')
166166 : zipWith reassign argNames tempNames
167− ++ [ContinueStmt () (Just (Id () name))]
167+ ++ [ContinueStmt () (Just (Id () (Var.safe name)))]
168168
169169 Let defs body ->
170170 do stmts <- mapM generateDef defs
@@ -226,7 +226,7 @@ generateTailFunction name args body =
226226 do code <- generateCode body
227227 return $ generateFunctionWithArity args $ JsBlock $ (:[]) $
228228 LabelledStmt ()
229− (Id () name)
229+ (Id () (Var.safe name))
230230 (WhileStmt () (BoolLit () True) (toStatement code))
231231
232232