@@ -824,6 +824,7 @@ jsERROR :: CompileInfo -> String -> JS
824jsERROR _ = JSError
824jsERROR _ = JSError
826jsSLIDE :: CompileInfo -> Int -> JS
826jsSLIDE :: CompileInfo -> Int -> JS
827+jsSLIDE _ 1 = JSAssign (jsLOC 0) (jsTOP 0)
827jsSLIDE _ n = JSApp (JSIdent "i$SLIDE") [JSNum (JSInt n)]
828jsSLIDE _ n = JSApp (JSIdent "i$SLIDE") [JSNum (JSInt n)]
829jsMKCON :: CompileInfo -> Reg -> Int -> [Reg] -> JS
830jsMKCON :: CompileInfo -> Reg -> Int -> [Reg] -> JS
@@ -931,6 +932,15 @@ jsCONSTCASE info reg cases def =
931 prepBranch bc = JSSeq $ map (translateBC info) bc
932 prepBranch bc = JSSeq $ map (translateBC info) bc
933jsPROJECT :: CompileInfo -> Reg -> Int -> Int -> JS
934jsPROJECT :: CompileInfo -> Reg -> Int -> Int -> JS
935+jsPROJECT _ reg loc 0 = JSNoop
936+jsPROJECT _ reg loc 1 =
937+ JSAssign (jsLOC loc) (
939+ JSProj (translateReg reg) "args"
934jsPROJECT _ reg loc ar =
944jsPROJECT _ reg loc ar =
935 JSApp (JSIdent "i$PROJECT") [ translateReg reg
945 JSApp (JSIdent "i$PROJECT") [ translateReg reg
936 , JSNum (JSInt loc)
946 , JSNum (JSInt loc)