summaryrefslogtreecommitdiff
path: root/src/jscomp.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2010-05-22 14:09:06 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2010-05-22 14:09:06 -0400
commit865b89fc5ebdcfd9e7490806176f79619b078d72 (patch)
treea42d0421aa4e9100ffb99558f7df1b127d523f6b /src/jscomp.sml
parent25792a154d53d515917c41256610a03a0a9de5f9 (diff)
Thunking recursive JavaScripted function ASTs, to reduce page load time dramatically
Diffstat (limited to 'src/jscomp.sml')
-rw-r--r--src/jscomp.sml3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml
index d774cd74..7610b6d2 100644
--- a/src/jscomp.sml
+++ b/src/jscomp.sml
@@ -565,7 +565,8 @@ fun process file =
val (e, st) = jsExp mode [] (e, st)
val e = deStrcat 0 e
- val sc = "urfuncs[" ^ Int.toString n ^ "] = " ^ e ^ ";\n"
+ val sc = "urfuncs[" ^ Int.toString n ^ "] = {c:\"t\",f:function(){return "
+ ^ e ^ "}};\n"
in
(*Print.prefaces "jsify'" [("old", MonoPrint.p_exp MonoEnv.empty old),
("new", MonoPrint.p_exp MonoEnv.empty new)];*)