@@ -353,6 +353,11 @@ reduceJS program =
353 funNames _ = error "WTF?"
353 funNames _ = error "WTF?"
355 reduceCall :: [String] -> JS -> JS
355 reduceCall :: [String] -> JS -> JS
356+ reduceCall funs (JSApp (JSRaw "__IDRRT__tailcall") [JSFunction [] (
357+ JSReturn (JSApp (JSRaw ret) [])
359+ | ret `elem` funs = JSRaw ret
356 reduceCall funs js@(JSApp (JSRaw fun) [])
361 reduceCall funs js@(JSApp (JSRaw fun) [])
357 | fun `elem` funs = JSRaw fun
362 | fun `elem` funs = JSRaw fun
358 | otherwise = js
363 | otherwise = js