on master help sign in
javascript: cleaned up
commit019ba6ec2d15e0763dd1fb1d44c272d41d0cdbbd authorraichoo <raichoo@googlemail.com> dateWed 22 Jan 2014, 23:58 (13 years ago) parentb059c08
1 file changed+8−1
src/IRTS/CodegenJavaScript.hs+8−1
src/IRTS/CodegenJavaScript.hs+8−1
@@ -801,7 +801,14 @@ codegenJavaScript target definitions filename outputType = do
801801
802802 functions :: [String]
803803 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
805812
806813 mainLoop :: String
807814 mainLoop = compileJS $