javascript: inline more constructors
commit4f4aea2565b6b0af251b46ba71bc75380a1161b1
authorraichoo <raichoo@googlemail.com>
dateMon 3 Feb 2014, 00:10 (13 years ago)
parent3177b98
src/IRTS/CodegenJavaScript.hs+7−2
@@ -606,11 +606,16 @@ inlineFunctions js =
606606 where
607607 inlineAble' :: JS -> Maybe JS
608608 inlineAble' (
609− JSReturn js@(JSNew "__IDRRT__Con" [JSNum _, JSArray [JSIdent _]])
610− ) = Just js
609+ JSReturn js@(JSNew "__IDRRT__Con" [JSNum _, JSArray vals])
610+ )
611+ | and $ map isJSIdent vals = Just js
611612
612613 inlineAble' _ = Nothing
613614
615+ isJSIdent js
616+ | JSIdent _ <- js = True
617+ | otherwise = False
618+
614619 inlineAble _ _ _ _ = Nothing
615620
616621