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
commitc71c554d4d6cfbb26985f87002d0dbf8766a03b4 (patch)
treeafcd03a0701dad1cab0952d31ab827a54bc474ae /tests/jsinj.ur
parent82580039f3e9a1ca41cc6aed5dfa02f3c944e796 (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>