summaryrefslogtreecommitdiff
path: root/src/jscomp.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-28 13:47:05 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-28 13:47:05 -0400
commitf69f45d06219f45b7b0d72930f71f215f488641b (patch)
treef9566ec4d3b69294e445ae920bad36a6a3db2b0c /src/jscomp.sml
parentbdd17680e61ac36aeefdbde7444381192127fe49 (diff)
Fix variable adjustment bug in fn/case alternation
Diffstat (limited to 'src/jscomp.sml')
-rw-r--r--src/jscomp.sml3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml
index 0e5c70de..3edb670f 100644
--- a/src/jscomp.sml
+++ b/src/jscomp.sml
@@ -913,9 +913,10 @@ fun process file =
val len = inner + len
val normalVars = List.tabulate (normalDepth, fn n => "_" ^ Int.toString (n + len))
val patVars = List.tabulate (depth, fn n => "d" ^ Int.toString n)
+ val caseVars = ListUtil.mapi (fn (i, _) => "c" ^ Int.toString i) pes
in
(strcat (str "(function (){ var "
- :: str (String.concatWith "," (normalVars @ patVars) ^ ";d0=")
+ :: str (String.concatWith "," (normalVars @ patVars @ caseVars) ^ ";d0=")
:: e
:: str ";\nreturn ("
:: List.revAppend (cases,