on master help sign in
javascript: collapse continuations
27c5ac6raichoo
src/IRTS/CodegenJavaScript.hs+9
@@ -1128,6 +1128,15 @@ evalCons js =
1128 JSReturn (JSIdent name)
1128 JSReturn (JSIdent name)
1129 )]) = JSIdent name
1129 )]) = JSIdent name
1130
1130
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+
1131 match js = transformJS match js
1140 match js = transformJS match js
1132
1141
1133
1142