Function-arguments-gc.js (956B)
1 // |reftest| skip-if(Android) 2 /* 3 * Any copyright is dedicated to the Public Domain. 4 * http://creativecommons.org/licenses/publicdomain/ 5 * Contributor: 6 * Christian Holler <decoder@own-hero.net> 7 */ 8 9 //----------------------------------------------------------------------------- 10 var BUGNUMBER = 623301; 11 var summary = "Properly root argument names during Function()"; 12 print(BUGNUMBER + ": " + summary); 13 14 /************** 15 * BEGIN TEST * 16 **************/ 17 18 if (typeof gczeal === "function") 19 gczeal(2); 20 21 function crashMe(n) 22 { 23 var nasty = []; 24 while (n--) 25 nasty.push("a" + n); 26 return Function.apply(null, nasty); 27 } 28 29 var count = 64; // exact value not important 30 assertEq(crashMe(count + 1).length, count); 31 32 if (typeof gczeal === "function") 33 gczeal(0); // reset 34 35 /******************************************************************************/ 36 37 if (typeof reportCompare === "function") 38 reportCompare(true, true); 39 40 print("All tests passed!");