@@ -436,16 +436,16 @@ inlineJS (JSApp (JSIdent "__IDRRT__tailcall") [
436inlineJS (JSApp (JSFunction [arg] (JSReturn ret)) [val])
436inlineJS (JSApp (JSFunction [arg] (JSReturn ret)) [val])
437 | JSNew con [tag, vals] <- ret
437 | JSNew con [tag, vals] <- ret
438 , opt <- inlineJS val =
438 , opt <- inlineJS val =
439− inlineJS $ JSNew con [tag, jsSubst (JSIdent arg) opt vals]
439+ inlineJS $ JSNew con [tag, inlineJS $ jsSubst (JSIdent arg) opt vals]
441 | JSNew con [JSFunction [] (JSReturn (JSApp fun vars))] <- ret
441 | JSNew con [JSFunction [] (JSReturn (JSApp fun vars))] <- ret
442 , opt <- inlineJS val =
442 , opt <- inlineJS val =
443 inlineJS $ JSNew con [JSFunction [] (
443 inlineJS $ JSNew con [JSFunction [] (
444 JSReturn (
444 JSReturn (
446− jsSubst (JSIdent arg) opt fun
446+ inlineJS $ jsSubst (JSIdent arg) opt fun
448− map (jsSubst (JSIdent arg) opt) vars
448+ map (inlineJS . jsSubst (JSIdent arg) opt) vars
@@ -453,26 +453,26 @@ inlineJS (JSApp (JSFunction [arg] (JSReturn ret)) [val])
453 | JSApp (JSProj obj field) args <- ret
453 | JSApp (JSProj obj field) args <- ret
454 , opt <- inlineJS val =
454 , opt <- inlineJS val =
455 inlineJS $ JSApp (
455 inlineJS $ JSApp (
456− JSProj (jsSubst (JSIdent arg) opt obj) field
456+ inlineJS $ JSProj (jsSubst (JSIdent arg) opt obj) field
458− map (jsSubst (JSIdent arg) opt) args
458+ map (inlineJS . jsSubst (JSIdent arg) opt) args
461 | JSIndex (JSProj obj field) idx <- ret
461 | JSIndex (JSProj obj field) idx <- ret
462 , opt <- inlineJS val =
462 , opt <- inlineJS val =
463 inlineJS $ JSIndex (JSProj (
463 inlineJS $ JSIndex (JSProj (
464− jsSubst (JSIdent arg) opt obj
464+ inlineJS $ jsSubst (JSIdent arg) opt obj
466− ) (jsSubst (JSIdent arg) opt idx)
466+ ) (inlineJS $ jsSubst (JSIdent arg) opt idx)
468 | JSOp op lhs rhs <- ret
468 | JSOp op lhs rhs <- ret
469 , opt <- inlineJS val =
469 , opt <- inlineJS val =
470− inlineJS $ JSOp op (jsSubst (JSIdent arg) opt lhs) $
470+ inlineJS $ JSOp op (inlineJS $ jsSubst (JSIdent arg) opt lhs) $
471− (jsSubst (JSIdent arg) opt rhs)
471+ (inlineJS $ jsSubst (JSIdent arg) opt rhs)
473 | JSApp (JSIdent fun) args <- ret
473 | JSApp (JSIdent fun) args <- ret
474 , opt <- inlineJS val =
474 , opt <- inlineJS val =
475− inlineJS $ JSApp (JSIdent fun) $ map (jsSubst (JSIdent arg) opt) args
475+ inlineJS $ JSApp (JSIdent fun) $ map (inlineJS . jsSubst (JSIdent arg) opt) args
477inlineJS (JSApp fun args) =
477inlineJS (JSApp fun args) =
478 JSApp (inlineJS fun) (map inlineJS args)
478 JSApp (inlineJS fun) (map inlineJS args)