on master help sign in
Fix function application code gen bug for >=10 arguments.
3783f26Max New
compiler/Generate/JavaScript.hs+2−1
@@ -140,7 +140,8 @@ expression (L span expr) =
140 args' <- mapM expression args
140 args' <- mapM expression args
141 return $ case args' of
141 return $ case args' of
142 [arg] -> func' <| arg
142 [arg] -> func' <| arg
143− _ -> ref aN `call` (func':args')
143+ _ | length args' <= 9 -> ref aN `call` (func':args')
144+ | otherwise -> foldl1 (<|) (func':args')
144 where
145 where
145 aN = "A" ++ show (length args)
146 aN = "A" ++ show (length args)
146 (func, args) = getArgs e1 [e2]
147 (func, args) = getArgs e1 [e2]