on master help sign in
javascript: inline some missed cases
0e17c90raichoo
src/IRTS/CodegenJavaScript.hs+6−6
@@ -412,11 +412,11 @@ inlineJS (JSApp (JSIdent "__IDRRT__tailcall") [
412inlineJS (JSApp (JSFunction [arg] (JSReturn ret)) [val])
412inlineJS (JSApp (JSFunction [arg] (JSReturn ret)) [val])
413 | JSNew con [tag, vals] <- ret
413 | JSNew con [tag, vals] <- ret
414 , opt <- inlineJS val =
414 , opt <- inlineJS val =
415− JSNew con [tag, jsSubst (JSIdent arg) opt vals]
415+ inlineJS $ JSNew con [tag, jsSubst (JSIdent arg) opt vals]
416
416
417 | JSNew con [JSFunction [] (JSReturn (JSApp fun vars))] <- ret
417 | JSNew con [JSFunction [] (JSReturn (JSApp fun vars))] <- ret
418 , opt <- inlineJS val =
418 , opt <- inlineJS val =
419− JSNew con [JSFunction [] (
419+ inlineJS $ JSNew con [JSFunction [] (
420 JSReturn (
420 JSReturn (
421 JSApp (
421 JSApp (
422 jsSubst (JSIdent arg) opt fun
422 jsSubst (JSIdent arg) opt fun
@@ -428,7 +428,7 @@ inlineJS (JSApp (JSFunction [arg] (JSReturn ret)) [val])
428
428
429 | JSApp (JSProj obj field) args <- ret
429 | JSApp (JSProj obj field) args <- ret
430 , opt <- inlineJS val =
430 , opt <- inlineJS val =
431− JSApp (
431+ inlineJS $ JSApp (
432 JSProj (jsSubst (JSIdent arg) opt obj) field
432 JSProj (jsSubst (JSIdent arg) opt obj) field
433 ) (
433 ) (
434 map (jsSubst (JSIdent arg) opt) args
434 map (jsSubst (JSIdent arg) opt) args
@@ -436,19 +436,19 @@ inlineJS (JSApp (JSFunction [arg] (JSReturn ret)) [val])
436
436
437 | JSIndex (JSProj obj field) idx <- ret
437 | JSIndex (JSProj obj field) idx <- ret
438 , opt <- inlineJS val =
438 , opt <- inlineJS val =
439− JSIndex (JSProj (
439+ inlineJS $ JSIndex (JSProj (
440 jsSubst (JSIdent arg) opt obj
440 jsSubst (JSIdent arg) opt obj
441 ) field
441 ) field
442 ) (jsSubst (JSIdent arg) opt idx)
442 ) (jsSubst (JSIdent arg) opt idx)
443
443
444 | JSOp op lhs rhs <- ret
444 | JSOp op lhs rhs <- ret
445 , opt <- inlineJS val =
445 , opt <- inlineJS val =
446− JSOp op (jsSubst (JSIdent arg) opt lhs) $
446+ inlineJS $ JSOp op (jsSubst (JSIdent arg) opt lhs) $
447 (jsSubst (JSIdent arg) opt rhs)
447 (jsSubst (JSIdent arg) opt rhs)
448
448
449 | JSApp (JSIdent fun) args <- ret
449 | JSApp (JSIdent fun) args <- ret
450 , opt <- inlineJS val =
450 , opt <- inlineJS val =
451− JSApp (JSIdent fun) $ map (jsSubst (JSIdent arg) opt) args
451+ inlineJS $ JSApp (JSIdent fun) $ map (jsSubst (JSIdent arg) opt) args
452
452
453inlineJS (JSApp fun args) =
453inlineJS (JSApp fun args) =
454 JSApp (inlineJS fun) (map inlineJS args)
454 JSApp (inlineJS fun) (map inlineJS args)