summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-02-08 16:54:01 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2011-02-08 16:54:01 -0500
commit7db27b06d50316f07bb38ddc5999d086be911ed2 (patch)
tree2f0fd30447bf7a6e3fb40aead813c7feeed11833 /src
parent58c927541d3960c0bca5636c05e499246d3cecef (diff)
Notice that Basis.now is effectful; smarter JavaScript encoding of initial source values built using server-side expressions that can't be turned into JavaScript
Diffstat (limited to 'src')
-rw-r--r--src/jscomp.sml12
-rw-r--r--src/settings.sml3
2 files changed, 14 insertions, 1 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml
index 2c00e04c..cd08cc0d 100644
--- a/src/jscomp.sml
+++ b/src/jscomp.sml
@@ -1186,6 +1186,18 @@ fun process file =
((EUnurlify (e, t, b), loc), st)
end
+ | EJavaScript (m as Source t, e') =>
+ (foundJavaScript := true;
+ let
+ val (x', st) = jsExp m (t :: outer) ((ERel 0, loc), st)
+ in
+ ((ELet ("x", t, e', x'), loc), st)
+ end
+ handle CantEmbed t => ((*ErrorMsg.errorAt loc "Unable to embed type in JavaScript";
+ Print.preface ("Type",
+ MonoPrint.p_typ MonoEnv.empty t);*)
+ (e, st)))
+
| EJavaScript (m, e') =>
(foundJavaScript := true;
jsExp m outer (e', st)
diff --git a/src/settings.sml b/src/settings.sml
index c5e1f929..30e925c9 100644
--- a/src/settings.sml
+++ b/src/settings.sml
@@ -139,7 +139,8 @@ val benignBase = basis ["get_cookie",
"kc",
"debug",
"naughtyDebug",
- "rand"]
+ "rand",
+ "now"]
val benign = ref benignBase
fun setBenignEffectful ls = benign := S.addList (benignBase, ls)