js/src/tests/js1_8_5/extensions/recursion.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 // |reftest| skip-if(xulRuntime.OS=="Darwin"&&isDebugBuild) -- this takes too long to over-recurse.
     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 = 622167;
    11 var summary = 'Handle infinite recursion';
    12 print(BUGNUMBER + ": " + summary);
    14 /**************
    15  * BEGIN TEST *
    16  **************/
    18 function eval() { eval(); }
    20 function DoWhile_3()
    21 {
    22   eval();
    23 }
    25 try
    26 {
    27   DoWhile_3();
    28 }
    29 catch(e) { }
    31 var r;
    32 function f()
    33 {
    34   r = arguments;
    35   test();
    36   yield 170;
    37 }
    39 function test()
    40 {
    41   function foopy()
    42   {
    43     try
    44     {
    45       for (var i in f());
    46     }
    47     catch (e) { }
    48   }
    49   foopy();
    50   gc();
    51 }
    52 test();
    54 /******************************************************************************/
    56 if (typeof reportCompare === "function")
    57   reportCompare(true, true);
    59 print("All tests passed!");

mercurial