on master help sign in
javascript: collapse continuations
commit27c5ac6ffec7d0995dc8cd91227c9e1b7511a4d9 authorraichoo <raichoo@googlemail.com> dateSat 8 Feb 2014, 16:03 (13 years ago) parentd700f08
1 file changed+9
src/IRTS/CodegenJavaScript.hs+9
src/IRTS/CodegenJavaScript.hs+9
@@ -1128,6 +1128,15 @@ evalCons js =
11281128 JSReturn (JSIdent name)
11291129 )]) = JSIdent name
11301130
1131+ match (JSNew "__IDRRT__Cont" [JSFunction [] (
1132+ JSReturn ret@(JSNew "__IDRRT__Con" [_, _, _, JSArray args])
1133+ )])
1134+ | all collapsable args = ret
1135+ where
1136+ collapsable :: JS -> Bool
1137+ collapsable (JSIdent _) = True
1138+ collapsable js = isJSConstant (map fst cons) js
1139+
11311140 match js = transformJS match js
11321141
11331142