on master help sign in
javascript: inline more functions
9d3ea3draichoo
src/IRTS/CodegenJavaScript.hs+6
@@ -610,6 +610,7 @@ inlineFunctions js =
610 JSReturn js@(JSNew "__IDRRT__Con" [JSNum _, JSArray vals])
610 JSReturn js@(JSNew "__IDRRT__Con" [JSNum _, JSArray vals])
611 )
611 )
612 | and $ map (\x -> isJSIdent x || isJSConstant x) vals = Just js
612 | and $ map (\x -> isJSIdent x || isJSConstant x) vals = Just js
613+
613 inlineAble' (
614 inlineAble' (
614 JSReturn js@(JSNew "__IDRRT__Cont" [JSFunction [] (
615 JSReturn js@(JSNew "__IDRRT__Cont" [JSFunction [] (
615 JSReturn (JSApp (JSIdent _) args)
616 JSReturn (JSApp (JSIdent _) args)
@@ -617,6 +618,11 @@ inlineFunctions js =
617 )
618 )
618 | and $ map (\x -> isJSIdent x || isJSConstant x) args = Just js
619 | and $ map (\x -> isJSIdent x || isJSConstant x) args = Just js
619
620
621+ inlineAble' (
622+ JSReturn js@(JSIndex (JSProj (JSApp (JSIdent _) args) "vars") _)
623+ )
624+ | and $ map (\x -> isJSIdent x || isJSConstant x) args = Just js
625+
620 inlineAble' _ = Nothing
626 inlineAble' _ = Nothing
621
627
622 isJSIdent js
628 isJSIdent js