js/src/tests/ecma_5/Function/Function-arguments-gc.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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  */
     9 //-----------------------------------------------------------------------------
    10 var BUGNUMBER = 623301;
    11 var summary = "Properly root argument names during Function()";
    12 print(BUGNUMBER + ": " + summary);
    14 /**************
    15  * BEGIN TEST *
    16  **************/
    18 if (typeof gczeal === "function")
    19   gczeal(2);
    21 function crashMe(n)
    22 {
    23   var nasty = [];
    24   while (n--)
    25     nasty.push("a" + n);
    26   return Function.apply(null, nasty);
    27 }
    29 var count = 64; // exact value not important
    30 assertEq(crashMe(count + 1).length, count);
    32 if (typeof gczeal === "function")
    33     gczeal(0); // reset
    35 /******************************************************************************/
    37 if (typeof reportCompare === "function")
    38   reportCompare(true, true);
    40 print("All tests passed!");

mercurial