on master help sign in
javascript: inline some missed cases
commitfed330ef892e04b700e7569988d80974b8f31402 authorraichoo <raichoo@googlemail.com> dateSat 1 Feb 2014, 00:59 (13 years ago) parent956a6df
1 file changed+10−10
src/IRTS/CodegenJavaScript.hs+10−10
src/IRTS/CodegenJavaScript.hs+10−10
@@ -436,16 +436,16 @@ inlineJS (JSApp (JSIdent "__IDRRT__tailcall") [
436436inlineJS (JSApp (JSFunction [arg] (JSReturn ret)) [val])
437437 | JSNew con [tag, vals] <- ret
438438 , opt <- inlineJS val =
439− inlineJS $ JSNew con [tag, jsSubst (JSIdent arg) opt vals]
439+ inlineJS $ JSNew con [tag, inlineJS $ jsSubst (JSIdent arg) opt vals]
440440
441441 | JSNew con [JSFunction [] (JSReturn (JSApp fun vars))] <- ret
442442 , opt <- inlineJS val =
443443 inlineJS $ JSNew con [JSFunction [] (
444444 JSReturn (
445445 JSApp (
446− jsSubst (JSIdent arg) opt fun
446+ inlineJS $ jsSubst (JSIdent arg) opt fun
447447 ) (
448− map (jsSubst (JSIdent arg) opt) vars
448+ map (inlineJS . jsSubst (JSIdent arg) opt) vars
449449 )
450450 )
451451 )]
@@ -453,26 +453,26 @@ inlineJS (JSApp (JSFunction [arg] (JSReturn ret)) [val])
453453 | JSApp (JSProj obj field) args <- ret
454454 , opt <- inlineJS val =
455455 inlineJS $ JSApp (
456− JSProj (jsSubst (JSIdent arg) opt obj) field
456+ inlineJS $ JSProj (jsSubst (JSIdent arg) opt obj) field
457457 ) (
458− map (jsSubst (JSIdent arg) opt) args
458+ map (inlineJS . jsSubst (JSIdent arg) opt) args
459459 )
460460
461461 | JSIndex (JSProj obj field) idx <- ret
462462 , opt <- inlineJS val =
463463 inlineJS $ JSIndex (JSProj (
464− jsSubst (JSIdent arg) opt obj
464+ inlineJS $ jsSubst (JSIdent arg) opt obj
465465 ) field
466− ) (jsSubst (JSIdent arg) opt idx)
466+ ) (inlineJS $ jsSubst (JSIdent arg) opt idx)
467467
468468 | JSOp op lhs rhs <- ret
469469 , opt <- inlineJS val =
470− inlineJS $ JSOp op (jsSubst (JSIdent arg) opt lhs) $
471− (jsSubst (JSIdent arg) opt rhs)
470+ inlineJS $ JSOp op (inlineJS $ jsSubst (JSIdent arg) opt lhs) $
471+ (inlineJS $ jsSubst (JSIdent arg) opt rhs)
472472
473473 | JSApp (JSIdent fun) args <- ret
474474 , 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
476476
477477inlineJS (JSApp fun args) =
478478 JSApp (inlineJS fun) (map inlineJS args)