head.js (668B)
1 /* Any copyright is dedicated to the Public Domain. 2 * http://creativecommons.org/publicdomain/zero/1.0/ 3 */ 4 5 var { NetUtil } = ChromeUtils.importESModule( 6 "resource://gre/modules/NetUtil.sys.mjs" 7 ); 8 9 // Helper to step a generator function and catch a StopIteration exception. 10 function do_run_generator(generator) { 11 try { 12 generator.next(); 13 } catch (e) { 14 do_throw("caught exception " + e, Components.stack.caller); 15 } 16 } 17 18 // Helper to finish a generator function test. 19 function do_finish_generator_test(generator) { 20 executeSoon(function () { 21 generator.return(); 22 do_test_finished(); 23 }); 24 } 25 26 function do_count_array(all) { 27 return all.length; 28 }