on master help sign in
Import everything in `Elm` namespace into every Elm program.
a46ff13evancz
elm/src/Gen/CompileToJS.hs+2−1
@@ -55,7 +55,8 @@ tryBlock escapees names e =
55
55
56jsModule (escapees, Module names exports imports stmts) =
56jsModule (escapees, Module names exports imports stmts) =
57 tryBlock escapees (tail modNames) $ concat
57 tryBlock escapees (tail modNames) $ concat
58+ [ "\nfor(var i in Elm) { this[i] = Elm[i]; }"
58− [ concatMap (\n -> globalAssign n $ n ++ " || {}") .
59+ , concatMap (\n -> globalAssign n $ n ++ " || {}") .
59 map (intercalate ".") . drop 2 . inits $
60 map (intercalate ".") . drop 2 . inits $
60 take (length modNames - 1) modNames
61 take (length modNames - 1) modNames
61 , "\nif (" ++ modName ++ ") throw \"Module name collision, '" ++
62 , "\nif (" ++ modName ++ ") throw \"Module name collision, '" ++