diff src/mono_opt.sml @ 769:efceae06df17

allow/deny working in Mono_opt
author Adam Chlipala <adamc@hcoop.net>
date Sat, 02 May 2009 13:37:52 -0400
parents 8688e01ae469
children 493f44759879
line wrap: on
line diff
--- a/src/mono_opt.sml	Sat May 02 13:23:07 2009 -0400
+++ b/src/mono_opt.sml	Sat May 02 13:37:52 2009 -0400
@@ -30,9 +30,6 @@
 open Mono
 structure U = MonoUtil
 
-val bless = ref (fn _ : string => true)
-val blessMime = ref (CharVector.all (fn ch => Char.isAlphaNum ch orelse ch = #"-" orelse ch = #"/" orelse ch = #"."))
-
 fun typ t = t
 fun decl d = d
 
@@ -382,16 +379,16 @@
       | EJavaScript (_, _, SOME (e, _)) => e
 
       | EFfiApp ("Basis", "bless", [(se as EPrim (Prim.String s), loc)]) =>
-        (if !bless s then
+        (if Settings.checkUrl s then
              ()
          else
-             ErrorMsg.errorAt loc "Invalid URL passed to 'bless'";
+             ErrorMsg.errorAt loc ("Invalid URL " ^ s ^ " passed to 'bless'");
          se)
       | EFfiApp ("Basis", "blessMime", [(se as EPrim (Prim.String s), loc)]) =>
-        (if !blessMime s then
+        (if Settings.checkMime s then
              ()
          else
-             ErrorMsg.errorAt loc "Invalid string passed to 'blessMime'";
+             ErrorMsg.errorAt loc ("Invalid string " ^ s ^ " passed to 'blessMime'");
          se)
 
       | EFfiApp ("Basis", "checkString", [(EPrim (Prim.String s), loc)]) =>