annotate tests/lessSafeFfi.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 3d10ae22abd6
children
rev   line source
adam@2010 1 ffi foo : int -> int
adam@2010 2 ffi bar serverOnly benignEffectful : int -> transaction unit
adam@2010 3 ffi baz : transaction int
adam@2038 4 ffi adder : int -> int -> int
adam@2010 5
adam@2038 6 ffi bup jsFunc "alert" : string -> transaction unit
adam@2039 7 ffi alert : string -> transaction unit
adam@2010 8
adam@2010 9 fun other () : transaction page =
adam@2010 10 (*bar 17;
adam@2010 11 q <- baz;*)
adam@2010 12 return <xml><body>
adam@2010 13 (*{[foo 42]}, {[q]}*)
adam@2039 14 <button value="bup" onclick={fn _ => bup "asdf"}/>
adam@2039 15 <button value="alert" onclick={fn _ => alert "qqqz"}/>
adam@2010 16 </body></xml>
adam@2010 17
adam@2010 18 fun main () = return <xml><body>
adam@2010 19 <form>
adam@2010 20 <submit action={other}/>
adam@2010 21 </form>
adam@2010 22 </body></xml>