summaryrefslogtreecommitdiff
path: root/tests/jsinj.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-01-01 15:11:17 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-01-01 15:11:17 -0500
commit8bb915433716ecfdcf2c2209d1a62796ebde4714 (patch)
treeafcd03a0701dad1cab0952d31ab827a54bc474ae /tests/jsinj.ur
parentef3b3f91435a9a924771c373dc53547e2ebd4503 (diff)
Injecting an int
Diffstat (limited to 'tests/jsinj.ur')
-rw-r--r--tests/jsinj.ur14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/jsinj.ur b/tests/jsinj.ur
new file mode 100644
index 00000000..194d26be
--- /dev/null
+++ b/tests/jsinj.ur
@@ -0,0 +1,14 @@
+cookie int : int
+
+fun getOpt (t ::: Type) (o : option t) (v : t) : t =
+ case o of
+ None => v
+ | Some x => x
+
+fun main () : transaction page =
+ n <- getCookie int;
+ sn <- source (getOpt n 7);
+ return <xml><body>
+ <dyn signal={n <- signal sn; return <xml>{[n]}</xml>}/>
+ <a onclick={set sn 6}>CHANGE</a>
+ </body></xml>