comparison src/jscomp.sml @ 1541:94ef0b07066a

Fix bug in JavaScript embedding of lists
author Adam Chlipala <adam@chlipala.net>
date Mon, 15 Aug 2011 12:33:28 -0400
parents 290de2dcecf6
children 15e0c935c91b
comparison
equal deleted inserted replaced
1540:659a2f71f5e5 1541:94ef0b07066a
183 183
184 val body = (ECase ((ERel 0, loc), 184 val body = (ECase ((ERel 0, loc),
185 [((PNone rt, loc), 185 [((PNone rt, loc),
186 str loc "null"), 186 str loc "null"),
187 ((PSome (rt, (PVar ("x", rt), loc)), loc), 187 ((PSome (rt, (PVar ("x", rt), loc)), loc),
188 strcat loc [str loc ((if isNullable t' then 188 strcat loc [str loc "{_1:",
189 "{v:"
190 else
191 "") ^ "{_1:"),
192 e', 189 e',
193 str loc ",_2:", 190 str loc ",_2:",
194 (EApp ((ENamed n', loc), 191 (EApp ((ENamed n', loc),
195 (EField ((ERel 0, loc), "2"), loc)), loc), 192 (EField ((ERel 0, loc), "2"), loc)), loc),
196 str loc ((if isNullable t' then 193 str loc "}"])],
197 "}"
198 else
199 "") ^ "}")])],
200 {disc = t, result = s}), loc) 194 {disc = t, result = s}), loc)
201 val body = (EAbs ("x", t, s, body), loc) 195 val body = (EAbs ("x", t, s, body), loc)
202 196
203 val st = {decls = ("jsify", n', (TFun (t, s), loc), 197 val st = {decls = ("jsify", n', (TFun (t, s), loc),
204 body, "jsify") :: #decls st, 198 body, "jsify") :: #decls st,