on master help sign in
Cosmetic: give function a more descriptive name
commit51ee065e6b321b849e439d3931c4f1bf40212961 authorEvan Czaplicki <info@elm-lang.org> dateMon 23 Dec 2013, 17:02 (13 years ago) parent230c695
1 file changed+3−3
compiler/Generate/JavaScript.hs+3−3
compiler/Generate/JavaScript.hs+3−3
@@ -156,11 +156,11 @@ expression (L span expr) =
156156 MultiIf branches ->
157157 do branches' <- forM branches $ \(b,e) -> (,) <$> expression b <*> expression e
158158 return $ case last branches of
159− (L _ (Var "Basics.otherwise"), _) -> els branches'
160− (L _ (Literal (Boolean True)), _) -> els branches'
159+ (L _ (Var "Basics.otherwise"), _) -> safeIfs branches'
160+ (L _ (Literal (Boolean True)), _) -> safeIfs branches'
161161 _ -> ifs branches' (obj "_E.If" `call` [ ref "$moduleName", string (show span) ])
162162 where
163− els branches = ifs (init branches) (snd (last branches))
163+ safeIfs branches = ifs (init branches) (snd (last branches))
164164 ifs branches finally = foldr iff finally branches
165165 iff (if', then') else' = CondExpr () if' then' else'
166166