diff options
author | 2009-08-11 11:26:37 -0400 | |
---|---|---|
committer | 2009-08-11 11:26:37 -0400 | |
commit | 86a182be33c265cd436d8ac4a8bb7baf797d9195 (patch) | |
tree | 89728704d7e0ae538803840021a54aa285296084 /src | |
parent | 1f98468265e6f5d652ed107a0bd89a319eca0297 (diff) |
Be careful in Jscomp to avoid interpreting non-boolean/reference types as booleans with ?:
Diffstat (limited to 'src')
-rw-r--r-- | src/jscomp.sml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml index d42c659e..f2a48cf3 100644 --- a/src/jscomp.sml +++ b/src/jscomp.sml @@ -585,7 +585,7 @@ fun process file = succ, str ")"] | PCon (Option, _, NONE) => - strcat [str ("(d" ^ Int.toString depth ^ "?"), + strcat [str ("(d" ^ Int.toString depth ^ "!=null?"), fail, str ":", succ, @@ -594,7 +594,7 @@ fun process file = (case IM.find (someTs, n) of NONE => raise Fail "Jscomp: Not in someTs" | SOME t => - strcat [str ("(d" ^ Int.toString depth ^ "?(d" + strcat [str ("(d" ^ Int.toString depth ^ "!=null?(d" ^ Int.toString (depth+1) ^ "=d" ^ Int.toString depth ^ (if isNullable t then ".v," @@ -634,12 +634,12 @@ fun process file = in succ end - | PNone _ => strcat [str ("(d" ^ Int.toString depth ^ "?"), + | PNone _ => strcat [str ("(d" ^ Int.toString depth ^ "!=null?"), fail, str ":", succ, str ")"] - | PSome (t, p) => strcat [str ("(d" ^ Int.toString depth ^ "?(d" ^ Int.toString (depth+1) + | PSome (t, p) => strcat [str ("(d" ^ Int.toString depth ^ "!=null?(d" ^ Int.toString (depth+1) ^ "=d" ^ Int.toString depth ^ (if isNullable t then ".v" |