comparison src/jscomp.sml @ 1847:8958b580d026

Change Name_js to skip code snippets that depend on the CSRF-protection signature
author Adam Chlipala <adam@chlipala.net>
date Mon, 01 Apr 2013 10:13:49 -0400
parents c1e3805e604e
children e15234fbb163
comparison
equal deleted inserted replaced
1846:bcae365efa85 1847:8958b580d026
505 fun jsifyStringMulti (n, s) = 505 fun jsifyStringMulti (n, s) =
506 case n of 506 case n of
507 0 => s 507 0 => s
508 | _ => jsifyStringMulti (n - 1, jsifyString s) 508 | _ => jsifyStringMulti (n - 1, jsifyString s)
509 509
510 fun deStrcat level (all as (e, _)) = 510 fun deStrcat level (all as (e, loc)) =
511 case e of 511 case e of
512 EPrim (Prim.String s) => jsifyStringMulti (level, s) 512 EPrim (Prim.String s) => jsifyStringMulti (level, s)
513 | EStrcat (e1, e2) => deStrcat level e1 ^ deStrcat level e2 513 | EStrcat (e1, e2) => deStrcat level e1 ^ deStrcat level e2
514 | EFfiApp ("Basis", "jsifyString", [(e, _)]) => "\"" ^ deStrcat (level + 1) e ^ "\"" 514 | EFfiApp ("Basis", "jsifyString", [(e, _)]) => "\"" ^ deStrcat (level + 1) e ^ "\""
515 | _ => (Print.prefaces "deStrcat" [("e", MonoPrint.p_exp MonoEnv.empty all)]; 515 | _ => (ErrorMsg.errorAt loc "Unexpected non-constant JavaScript code";
516 raise Fail "Jscomp: deStrcat") 516 Print.prefaces "deStrcat" [("e", MonoPrint.p_exp MonoEnv.empty all)];
517 "")
517 518
518 val quoteExp = quoteExp loc 519 val quoteExp = quoteExp loc
519 in 520 in
520 (*Print.prefaces "jsE" [("e", MonoPrint.p_exp MonoEnv.empty e), 521 (*Print.prefaces "jsE" [("e", MonoPrint.p_exp MonoEnv.empty e),
521 ("inner", Print.PD.string (Int.toString inner))];*) 522 ("inner", Print.PD.string (Int.toString inner))];*)