summaryrefslogtreecommitdiff
path: root/src/jscomp.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-06-13 14:29:36 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-06-13 14:29:36 -0400
commitba3e01e524907d85f5cba6af62083fcdee606f33 (patch)
tree1f400f83f20ef1f54d68e1e7b674a08f29abb4d4 /src/jscomp.sml
parentb7de8e9ac590f9d06df72d22489375b33a6efef9 (diff)
<dyn> inside <table>; fix Specialize bug with datatype decls generating other mutually-recursive datatype decls
Diffstat (limited to 'src/jscomp.sml')
-rw-r--r--src/jscomp.sml16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml
index 75cca425..9f0a7a1b 100644
--- a/src/jscomp.sml
+++ b/src/jscomp.sml
@@ -171,6 +171,13 @@ val compact =
exception CantEmbed of typ
+fun inString {needle, haystack} =
+ let
+ val (_, suffix) = Substring.position needle (Substring.full haystack)
+ in
+ not (Substring.isEmpty suffix)
+ end
+
fun process file =
let
val (someTs, nameds) =
@@ -1086,7 +1093,14 @@ fun process file =
fun exp outer (e as (_, loc), st) =
((*Print.preface ("exp", MonoPrint.p_exp MonoEnv.empty e);*)
case #1 e of
- EPrim _ => (e, st)
+ EPrim p =>
+ (case p of
+ Prim.String s => if inString {needle = "<script", haystack = s} then
+ foundJavaScript := true
+ else
+ ()
+ | _ => ();
+ (e, st))
| ERel _ => (e, st)
| ENamed _ => (e, st)
| ECon (_, _, NONE) => (e, st)