# HG changeset patch # User Adam Chlipala # Date 1343580857 14400 # Node ID 10a2cb93d175ae8abbda0fc602dad670c7a213db # Parent bb942416bf1cb50632df86e308fe8cafed2c1da7 Removed evaluation of js function name strings. (from Vladimir Shabanov) diff -r bb942416bf1c -r 10a2cb93d175 lib/js/urweb.js --- a/lib/js/urweb.js Sun Jul 29 12:27:13 2012 -0400 +++ b/lib/js/urweb.js Sun Jul 29 12:54:17 2012 -0400 @@ -1711,10 +1711,10 @@ break; case "f": if (e.a == null) - e = {c: "c", v: (eval(e.f))()}; + e = {c: "c", v: e.f()}; else { var args = []; - stack = cons({c: "f", f: eval(e.f), args: args, pos: 0, a: e.a.next}, stack); + stack = cons({c: "f", f: e.f, args: args, pos: 0, a: e.a.next}, stack); if (!e.a.data.c) alert("[2] fr.f = " + e.f + "; 0 = " + e.a.data); e = e.a.data; } diff -r bb942416bf1c -r 10a2cb93d175 src/jscomp.sml --- a/src/jscomp.sml Sun Jul 29 12:27:13 2012 -0400 +++ b/src/jscomp.sml Sun Jul 29 12:54:17 2012 -0400 @@ -1,4 +1,4 @@ -(* Copyright (c) 2008-2011, Adam Chlipala +(* Copyright (c) 2008-2012, Adam Chlipala * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -658,7 +658,7 @@ end) (str "null", st) args in - (strcat [str ("{c:\"f\",f:\"" ^ name ^ "\",a:"), + (strcat [str ("{c:\"f\",f:" ^ name ^ ",a:"), e, str "}"], st) @@ -693,7 +693,7 @@ val (e, st) = jsE inner (e, st) in - (strcat [str ("{c:\"f\",f:\"" ^ name ^ "\",a:cons("), + (strcat [str ("{c:\"f\",f:" ^ name ^ ",a:cons("), e, str ",null)}"], st) @@ -718,7 +718,7 @@ val (e1, st) = jsE inner (e1, st) val (e2, st) = jsE inner (e2, st) in - (strcat [str ("{c:\"f\",f:\"" ^ name ^ "\",a:cons("), + (strcat [str ("{c:\"f\",f:" ^ name ^ ",a:cons("), e1, str ",cons(", e2, @@ -822,14 +822,14 @@ val (e1, st) = jsE inner (e1, st) val (e2, st) = jsE inner (e2, st) in - (strcat [str "{c:\"f\",f:\"cat\",a:cons(", e1, str ",cons(", e2, str ",null))}"], st) + (strcat [str "{c:\"f\",f:cat,a:cons(", e1, str ",cons(", e2, str ",null))}"], st) end | EError (e, _) => let val (e, st) = jsE inner (e, st) in - (strcat [str "{c:\"f\",f:\"er\",a:cons(", e, str ",null)}"], + (strcat [str "{c:\"f\",f:er,a:cons(", e, str ",null)}"], st) end @@ -878,7 +878,7 @@ let val (e, st) = jsE inner (e, st) in - (strcat [str "{c:\"f\",f:\"redirect\",a:cons(", + (strcat [str "{c:\"f\",f:redirect,a:cons(", e, str ",null)}"], st) @@ -891,7 +891,7 @@ val (e, st) = jsE inner (e, st) val (e', st) = unurlifyExp loc (t, st) in - (strcat [str ("{c:\"f\",f:\"unurlify\",a:cons({c:\"c\",v:function(s){var t=s.split(\"/\");var i=0;return " + (strcat [str ("{c:\"f\",f:unurlify,a:cons({c:\"c\",v:function(s){var t=s.split(\"/\");var i=0;return " ^ e' ^ "}},cons("), e, str ",null))}"], @@ -902,7 +902,7 @@ let val (e, st) = jsE inner (e, st) in - (strcat [str "{c:\"f\",f:\"sr\",a:cons(", + (strcat [str "{c:\"f\",f:sr,a:cons(", e, str ",null)}"], st) @@ -912,7 +912,7 @@ val (e1, st) = jsE inner (e1, st) val (e2, st) = jsE inner (e2, st) in - (strcat [str "{c:\"f\",f:\"sb\",a:cons(", + (strcat [str "{c:\"f\",f:sb,a:cons(", e1, str ",cons(", e2, @@ -923,7 +923,7 @@ let val (e, st) = jsE inner (e, st) in - (strcat [str "{c:\"f\",f:\"ss\",a:cons(", + (strcat [str "{c:\"f\",f:ss,a:cons(", e, str ",null)}"], st) @@ -934,7 +934,7 @@ val (e, st) = jsE inner (e, st) val (unurl, st) = unurlifyExp loc (t, st) in - (strcat [str ("{c:\"f\",f:\"rc\",a:cons({c:\"c\",v:\"" + (strcat [str ("{c:\"f\",f:rc,a:cons({c:\"c\",v:\"" ^ Settings.getUrlPrefix () ^ "\"},cons("), e, @@ -952,7 +952,7 @@ val (e, st) = jsE inner (e, st) val (unurl, st) = unurlifyExp loc (t, st) in - (strcat [str ("{c:\"f\",f:\"rv\",a:cons("), + (strcat [str ("{c:\"f\",f:rv,a:cons("), e, str (",cons({c:\"c\",v:function(s){var t=s.split(\"/\");var i=0;return " ^ unurl ^ "}},cons({c:\"K\"},null)))}")], @@ -963,7 +963,7 @@ let val (e, st) = jsE inner (e, st) in - (strcat [str "{c:\"f\",f:\"sl\",a:cons(", + (strcat [str "{c:\"f\",f:sl,a:cons(", e, str ",cons({c:\"K\"},null))}"], st) @@ -973,7 +973,7 @@ let val (e, st) = jsE inner (e, st) in - (strcat [str "{c:\"f\",f:\"sp\",a:cons(", + (strcat [str "{c:\"f\",f:sp,a:cons(", e, str ",null)}"], st)