# HG changeset patch # User Adam Chlipala # Date 1297202041 18000 # Node ID 07ef5771568db14334a330995299a075d053907e # Parent 3dab4696d1166440254219093650d1074160bbfe 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 diff -r 3dab4696d116 -r 07ef5771568d src/jscomp.sml --- a/src/jscomp.sml Thu Feb 03 21:04:12 2011 -0500 +++ b/src/jscomp.sml Tue Feb 08 16:54:01 2011 -0500 @@ -1186,6 +1186,18 @@ ((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 -r 3dab4696d116 -r 07ef5771568d src/settings.sml --- a/src/settings.sml Thu Feb 03 21:04:12 2011 -0500 +++ b/src/settings.sml Tue Feb 08 16:54:01 2011 -0500 @@ -139,7 +139,8 @@ "kc", "debug", "naughtyDebug", - "rand"] + "rand", + "now"] val benign = ref benignBase fun setBenignEffectful ls = benign := S.addList (benignBase, ls)