comparison src/jscomp.sml @ 703:a5d8b470d7ca

Fixing some regressions and other bugs
author Adam Chlipala <adamc@hcoop.net>
date Sun, 05 Apr 2009 16:17:32 -0400
parents 500e93aa436f
children 6fc633d990e7
comparison
equal deleted inserted replaced
702:5b8617b73540 703:a5d8b470d7ca
362 val e = if isNullable t then 362 val e = if isNullable t then
363 "{v:" ^ e ^ "}" 363 "{v:" ^ e ^ "}"
364 else 364 else
365 e 365 e
366 in 366 in
367 ("(uu=t[i++],uu==\"Some\"?" ^ e ^ ":null)", st) 367 ("(t[i++]==\"Some\"?" ^ e ^ ":null)", st)
368 end 368 end
369 369
370 | TDatatype (n, ref (dk, cs)) => 370 | TDatatype (n, ref (dk, cs)) =>
371 (case IM.find (#decoders st, n) of 371 (case IM.find (#decoders st, n) of
372 SOME n' => ("(tmp=_n" ^ Int.toString n' ^ "(t,i),i=tmp._1,tmp._2)", st) 372 SOME n' => ("(tmp=_n" ^ Int.toString n' ^ "(t,i),i=tmp._1,tmp._2)", st)
859 859
860 | EError (e, _) => 860 | EError (e, _) =>
861 let 861 let
862 val (e, st) = jsE inner (e, st) 862 val (e, st) = jsE inner (e, st)
863 in 863 in
864 (strcat [str "alert(\"ERROR: \"+", e, str ")"], 864 (strcat [str "alert(cat(\"ERROR: \",", e, str "))"],
865 st) 865 st)
866 end 866 end
867 867
868 | EWrite e => 868 | EWrite e =>
869 let 869 let
950 let 950 let
951 val (e, st) = jsE inner (e, st) 951 val (e, st) = jsE inner (e, st)
952 val (ek, st) = jsE inner (ek, st) 952 val (ek, st) = jsE inner (ek, st)
953 val (unurl, st) = unurlifyExp loc (t, st) 953 val (unurl, st) = unurlifyExp loc (t, st)
954 in 954 in
955 (strcat [str ("rc(\"" ^ !Monoize.urlPrefix ^ "\"+"), 955 (strcat [str ("rc(cat(\"" ^ !Monoize.urlPrefix ^ "\","),
956 e, 956 e,
957 str (", function(s){var t=s.split(\"/\");var i=0;return " 957 str ("), function(s){var t=s.split(\"/\");var i=0;return "
958 ^ unurl ^ "},"), 958 ^ unurl ^ "},"),
959 ek, 959 ek,
960 str ")"], 960 str ")"],
961 st) 961 st)
962 end 962 end