diff options
Diffstat (limited to 'src/jscomp.sml')
-rw-r--r-- | src/jscomp.sml | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml index ffb68ab2..887fbc87 100644 --- a/src/jscomp.sml +++ b/src/jscomp.sml @@ -507,13 +507,14 @@ fun process (file : file) = 0 => s | _ => jsifyStringMulti (n - 1, jsifyString s) - fun deStrcat level (all as (e, _)) = + fun deStrcat level (all as (e, loc)) = case e of EPrim (Prim.String s) => jsifyStringMulti (level, s) | EStrcat (e1, e2) => deStrcat level e1 ^ deStrcat level e2 | EFfiApp ("Basis", "jsifyString", [(e, _)]) => "\"" ^ deStrcat (level + 1) e ^ "\"" - | _ => (Print.prefaces "deStrcat" [("e", MonoPrint.p_exp MonoEnv.empty all)]; - raise Fail "Jscomp: deStrcat") + | _ => (ErrorMsg.errorAt loc "Unexpected non-constant JavaScript code"; + Print.prefaces "deStrcat" [("e", MonoPrint.p_exp MonoEnv.empty all)]; + "") val quoteExp = quoteExp loc in |