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

Sources/ucode/tests/custom/04_modules/25_required_closure_release

  1 include() and render() release the main function of the file that they ran.
  2 Without the collector, a loop over them must not add live values.
  3 
  4 -- Testcase --
  5 function count(label, fn) {
  6         let live = gc("count");
  7 
  8         for (let i = 0; i < 100; i++)
  9                 fn();
 10 
 11         print(label, ": ", gc("count") - live, "\n");
 12 }
 13 
 14 count("include", () => include("files/script.uc"));
 15 count("render", () => render("files/script.uc"));
 16 -- End --
 17 
 18 -- File script.uc --
 19 let a = 1;
 20 -- End --
 21 
 22 -- Args --
 23 -R
 24 -- End --
 25 
 26 -- Expect stdout --
 27 include: 0
 28 render: 0
 29 -- End --

This page was automatically generated by LXR 0.3.1.  •  OpenWrt