summaryrefslogtreecommitdiff
path: root/src/monoize.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/monoize.sml')
-rw-r--r--src/monoize.sml18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/monoize.sml b/src/monoize.sml
index 0e122c29..a5dc3929 100644
--- a/src/monoize.sml
+++ b/src/monoize.sml
@@ -2787,12 +2787,28 @@ fun monoExp (env, st, fm) (all as (e, loc)) =
(L'.EJavaScript (L'.Script, e), loc),
str ");"]))
attrs
+
+ val t = (L'.TFfi ("Basis", "string"), loc)
+ val setClass = (L'.ECase (class,
+ [((L'.PNone t, loc),
+ str ""),
+ ((L'.PSome (t, (L'.PVar ("x", t), loc)), loc),
+ (L'.EStrcat ((L'.EPrim (Prim.String "d.className=\""), loc),
+ (L'.EStrcat ((L'.ERel 0, loc),
+ (L'.EPrim (Prim.String "\";"), loc)), loc)),
+ loc))],
+ {disc = (L'.TOption t, loc),
+ result = t}), loc)
in
case assgns of
- [] => jexp
+ [] => strcat [str "var d=",
+ jexp,
+ str ";",
+ setClass]
| _ => strcat (str "var d="
:: jexp
:: str ";"
+ :: setClass
:: assgns)
end