diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-02-08 16:54:01 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-02-08 16:54:01 -0500 |
commit | 6ac0f0338084612d367def5b8518bd4514c3f9a4 (patch) | |
tree | 2f0fd30447bf7a6e3fb40aead813c7feeed11833 /src | |
parent | b9d68f77db05b61f29dba9a5680d4875b95e0e2f (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.sml | 12 | ||||
-rw-r--r-- | src/settings.sml | 3 |
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) |