on master help sign in
Fix #772, make case expression variable names safe
6ee6a3eEvan Czaplicki
compiler/Generate/JavaScript.hs+1−1
@@ -163,7 +163,7 @@ expression (A region expr) =
163 (revisedMatch, stmt) <-
163 (revisedMatch, stmt) <-
164 case e of
164 case e of
165 A _ (Var (Var.Canonical Var.Local x)) ->
165 A _ (Var (Var.Canonical Var.Local x)) ->
166− return (Case.matchSubst [(tempVar,x)] initialMatch, [])
166+ return (Case.matchSubst [(tempVar, Var.varName x)] initialMatch, [])
167 _ ->
167 _ ->
168 do e' <- expression e
168 do e' <- expression e
169 return (initialMatch, [VarDeclStmt () [varDecl tempVar e']])
169 return (initialMatch, [VarDeclStmt () [varDecl tempVar e']])