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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/js1_8_5/extensions/recursion.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,59 @@
     1.4 +// |reftest| skip-if(xulRuntime.OS=="Darwin"&&isDebugBuild) -- this takes too long to over-recurse.
     1.5 +/*
     1.6 + * Any copyright is dedicated to the Public Domain.
     1.7 + * http://creativecommons.org/licenses/publicdomain/
     1.8 + * Contributor:
     1.9 + *   Christian Holler <decoder@own-hero.net>
    1.10 + */
    1.11 +
    1.12 +//-----------------------------------------------------------------------------
    1.13 +var BUGNUMBER = 622167;
    1.14 +var summary = 'Handle infinite recursion';
    1.15 +print(BUGNUMBER + ": " + summary);
    1.16 +
    1.17 +/**************
    1.18 + * BEGIN TEST *
    1.19 + **************/
    1.20 +
    1.21 +function eval() { eval(); }
    1.22 +
    1.23 +function DoWhile_3()
    1.24 +{
    1.25 +  eval();
    1.26 +}
    1.27 +
    1.28 +try
    1.29 +{
    1.30 +  DoWhile_3();
    1.31 +}
    1.32 +catch(e) { }
    1.33 +
    1.34 +var r;
    1.35 +function f()
    1.36 +{
    1.37 +  r = arguments;
    1.38 +  test();
    1.39 +  yield 170;
    1.40 +}
    1.41 +
    1.42 +function test()
    1.43 +{
    1.44 +  function foopy()
    1.45 +  {
    1.46 +    try
    1.47 +    {
    1.48 +      for (var i in f());
    1.49 +    }
    1.50 +    catch (e) { }
    1.51 +  }
    1.52 +  foopy();
    1.53 +  gc();
    1.54 +}
    1.55 +test();
    1.56 +
    1.57 +/******************************************************************************/
    1.58 +
    1.59 +if (typeof reportCompare === "function")
    1.60 +  reportCompare(true, true);
    1.61 +
    1.62 +print("All tests passed!");

mercurial