Start using strict mode for everything
V8 engineer said it is always faster, so that’s probably reliable info :)
This commit is contained in:
parent
25e88a20b2
commit
efdc7a7744
2 changed files with 4 additions and 2 deletions
3
Setup.hs
3
Setup.hs
|
@ -148,7 +148,8 @@ buildRuntime :: LocalBuildInfo -> [FilePath] -> IO ()
|
||||||
buildRuntime lbi elmos = do
|
buildRuntime lbi elmos = do
|
||||||
createDirectoryIfMissing True (rtsDir lbi)
|
createDirectoryIfMissing True (rtsDir lbi)
|
||||||
let rts' = rts lbi
|
let rts' = rts lbi
|
||||||
writeFile rts' "var Elm = {}; Elm.Native = {}; Elm.Native.Graphics = {};\n\
|
writeFile rts' "'use strict';\n\
|
||||||
|
\var Elm = {}; Elm.Native = {}; Elm.Native.Graphics = {};\n\
|
||||||
\var ElmRuntime = {}; ElmRuntime.Render = {};\n"
|
\var ElmRuntime = {}; ElmRuntime.Render = {};\n"
|
||||||
mapM_ (appendTo rts') =<< getFiles ".js" "libraries"
|
mapM_ (appendTo rts') =<< getFiles ".js" "libraries"
|
||||||
mapM_ (appendTo rts') elmos
|
mapM_ (appendTo rts') elmos
|
||||||
|
|
|
@ -293,7 +293,8 @@ generate unsafeModule =
|
||||||
thisModule = dotSep ("_elm" : names modul ++ ["values"])
|
thisModule = dotSep ("_elm" : names modul ++ ["values"])
|
||||||
programStmts =
|
programStmts =
|
||||||
concat
|
concat
|
||||||
[ setup (Just "_elm") (names modul ++ ["values"])
|
[ [ ExprStmt () $ string "use strict" ]
|
||||||
|
, setup (Just "_elm") (names modul ++ ["values"])
|
||||||
, [ IfSingleStmt () thisModule (ret thisModule) ]
|
, [ IfSingleStmt () thisModule (ret thisModule) ]
|
||||||
, [ internalImports (List.intercalate "." (names modul)) ]
|
, [ internalImports (List.intercalate "." (names modul)) ]
|
||||||
, concatMap jsImport . Set.toList . Set.fromList . map fst $ imports modul
|
, concatMap jsImport . Set.toList . Set.fromList . map fst $ imports modul
|
||||||
|
|
Loading…
Reference in a new issue