diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/elab_err.sml | 4 | ||||
-rw-r--r-- | src/jscomp.sml | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/elab_err.sml b/src/elab_err.sml index f6fec25b..dc34560b 100644 --- a/src/elab_err.sml +++ b/src/elab_err.sml @@ -218,7 +218,7 @@ fun expError env err = ("Type", p_con env c)]) co) | Unresolvable (loc, c) => (ErrorMsg.errorAt loc "Can't resolve type class instance"; - eprefaces' [("Class constraint", p_con env c), + eprefaces' [("Class constraint", p_con env c)(*, ("Class database", p_list (fn (c, rules) => box [P.p_con env c, PD.string ":", @@ -228,7 +228,7 @@ fun expError env err = PD.string ":", space, P.p_con env c]) rules]) - (E.listClasses env))]) + (E.listClasses env))*)]) | IllegalRec (x, e) => (ErrorMsg.errorAt (#2 e) "Illegal 'val rec' righthand side (must be a function abstraction)"; eprefaces' [("Variable", PD.string x), diff --git a/src/jscomp.sml b/src/jscomp.sml index 9f0a7a1b..79ae814e 100644 --- a/src/jscomp.sml +++ b/src/jscomp.sml @@ -980,12 +980,18 @@ fun process file = jsE inner (e, st)) | EJavaScript (_, e) => let + val locals = List.tabulate + (varDepth e, + fn i => str ("var _" ^ Int.toString (len + inner + i) ^ ";")) + val (e, st) = jsE inner (e, st) in foundJavaScript := true; - (strcat [str "cs(function(){return ", - compact inner e, - str "})"], + (strcat (str "cs(function(){" + :: locals + @ [str "return ", + compact inner e, + str "})"]), st) end |