summaryrefslogtreecommitdiff
path: root/src/jscomp.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-03-29 11:37:29 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-03-29 11:37:29 -0400
commit843fcc973f4cf7b149d4f57732fb66f812115320 (patch)
treebae33dd5ebd8393e6dd1b30f7d1a2b75241c9956 /src/jscomp.sml
parent9f3c3a0215d3f23c8e51fa4824d21dfeaa08ede0 (diff)
Redo channels, making them single-client
Diffstat (limited to 'src/jscomp.sml')
-rw-r--r--src/jscomp.sml5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml
index f5627e24..a487eeab 100644
--- a/src/jscomp.sml
+++ b/src/jscomp.sml
@@ -49,7 +49,6 @@ val funcs = [(("Basis", "alert"), "alert"),
(("Basis", "urlifyInt"), "ts"),
(("Basis", "urlifyFloat"), "ts"),
(("Basis", "urlifyString"), "uf"),
- (("Basis", "urlifyChannel"), "ts"),
(("Basis", "recv"), "rv")]
structure FM = BinaryMapFn(struct
@@ -220,7 +219,7 @@ fun process file =
| TFfi ("Basis", "string") => ((EFfiApp ("Basis", "jsifyString", [e]), loc), st)
| TFfi ("Basis", "int") => ((EFfiApp ("Basis", "htmlifyInt", [e]), loc), st)
| TFfi ("Basis", "float") => ((EFfiApp ("Basis", "htmlifyFloat", [e]), loc), st)
- | TFfi ("Basis", "channel") => ((EFfiApp ("Basis", "htmlifyChannel", [e]), loc), st)
+ | TFfi ("Basis", "channel") => ((EFfiApp ("Basis", "jsifyChannel", [e]), loc), st)
| TFfi ("Basis", "bool") => ((ECase (e,
[((PCon (Enum, PConFfi {mod = "Basis",
@@ -348,7 +347,7 @@ fun process file =
| TFfi ("Basis", "string") => ("uu(t[i++])", st)
| TFfi ("Basis", "int") => ("parseInt(t[i++])", st)
| TFfi ("Basis", "float") => ("parseFloat(t[i++])", st)
- | TFfi ("Basis", "channel") => ("parseInt(t[i++])", st)
+ | TFfi ("Basis", "channel") => ("(t[i++].length > 0 ? parseInt(t[i]) : null)", st)
| TFfi ("Basis", "bool") => ("t[i++] == \"True\"", st)