• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/ucode/tests/custom/06_lib_uloop/12_callback_exit

  1 Calling exit() in a uloop callback ends the loop and terminates the script
  2 with the given code, also when an exception guard is set. The guard does not
  3 receive the exit request.
  4 
  5 -- Testcase --
  6 {%
  7         import * as uloop from 'uloop';
  8 
  9         uloop.init();
 10 
 11         uloop.guard((e) => print(`guard: ${e.type}\n`));
 12 
 13         uloop.timer(10, () => exit(4));
 14         uloop.timer(100, () => {
 15                 print("loop kept running\n");
 16                 uloop.end();
 17         });
 18 
 19         uloop.run();
 20         print("run() returned\n");
 21 %}
 22 -- End --
 23 
 24 -- Expect exitcode --
 25 4
 26 -- End --

This page was automatically generated by LXR 0.3.1.  •  OpenWrt