on master help sign in
javascript: cleaned up
019ba6eraichoo
src/IRTS/CodegenJavaScript.hs+8−1
@@ -801,7 +801,14 @@ codegenJavaScript target definitions filename outputType = do
801
801
802 functions :: [String]
802 functions :: [String]
803 functions =
803 functions =
804− map (compileJS . removeAllocations) $ initConstructors (map reduceConstants ((reduceJS . removeIDs) $ map (optimizeJS . translateDeclaration) def))
804+ let translated = map translateDeclaration def
805+ optimized = map optimizeJS translated
806+ idsRemoved = removeIDs optimized
807+ reduced = reduceJS idsRemoved
808+ constRemoved = map reduceConstants reduced
809+ constrInit = initConstructors constRemoved
810+ js = map removeAllocations constrInit in
811+ map compileJS js
805
812
806 mainLoop :: String
813 mainLoop :: String
807 mainLoop = compileJS $
814 mainLoop = compileJS $