Mercurial > urweb
annotate tests/active.ur @ 2070:382911d72e63
Check realloc's return code to prevent segfault on out of memory condition (Part 3)
author | Sergey Mironov <grrwlf@gmail.com> |
---|---|
date | Tue, 02 Sep 2014 17:37:22 +0000 |
parents | d794149b3713 |
children |
rev | line source |
---|---|
adam@1786 | 1 fun counter' () = |
adam@1786 | 2 s <- source 0; |
adam@1786 | 3 return <xml> |
adam@1786 | 4 <dyn signal={n <- signal s; return (txt n)}/> |
adam@1786 | 5 <button onclick={fn _ => n <- get s; set s (n + 1)}/> |
adam@1786 | 6 </xml> |
adam@1786 | 7 |
adam@1786 | 8 fun counter () = <xml><active code={counter' ()}/></xml> |
adam@1786 | 9 |
adam@1786 | 10 fun main () : transaction page = return <xml><body> |
adam@1786 | 11 {counter ()} |
adam@1786 | 12 <hr/> |
adam@1786 | 13 {counter ()} |
adam@1786 | 14 </body></xml> |