diff src/scriptcheck.sml @ 970:8371d12ae63f

Hopefully complete refactoring of Jscomp to output ASTs; partial implementation of interpreter in runtime system (demo/alert works)
author Adam Chlipala <adamc@hcoop.net>
date Tue, 22 Sep 2009 12:23:21 -0400
parents 346cf1908a17
children 217eb87dde31
line wrap: on
line diff
--- a/src/scriptcheck.sml	Tue Sep 22 09:53:05 2009 -0400
+++ b/src/scriptcheck.sml	Tue Sep 22 12:23:21 2009 -0400
@@ -67,7 +67,7 @@
               "unload"]
                 
 val scriptWords = "<script"
-                   :: map (fn s => "on" ^ s ^ " ='") events
+                   :: map (fn s => " on" ^ s ^ "='") events
 
 val pushWords = ["rv("]
 
@@ -75,12 +75,7 @@
     let
         val proto = Settings.currentProtocol ()
 
-        fun inString {needle, haystack} =
-            let
-                val (_, suffix) = Substring.position needle (Substring.full haystack)
-            in
-                not (Substring.isEmpty suffix)
-            end
+        fun inString {needle, haystack} = String.isSubstring needle haystack
 
         fun hasClient {basis, words, onload} csids =
             let