js/src/tests/js1_8_1/regress/regress-452498-117.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/js1_8_1/regress/regress-452498-117.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,126 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +//-----------------------------------------------------------------------------
    1.10 +var BUGNUMBER = 452498;
    1.11 +var summary = 'TM: upvar2 regression tests';
    1.12 +var actual = '';
    1.13 +var expect = '';
    1.14 +
    1.15 +
    1.16 +//-----------------------------------------------------------------------------
    1.17 +test();
    1.18 +//-----------------------------------------------------------------------------
    1.19 +
    1.20 +function test()
    1.21 +{
    1.22 +  enterFunc ('test');
    1.23 +  printBugNumber(BUGNUMBER);
    1.24 +  printStatus (summary);
    1.25 +
    1.26 +// ------- Comment #117 From Gary Kwong [:nth10sd]
    1.27 +
    1.28 +// The following all do not require -j.
    1.29 +
    1.30 +// =====
    1.31 +
    1.32 +  try
    1.33 +  {
    1.34 +    eval('x; function  x(){}; const x;');
    1.35 +  }
    1.36 +  catch(ex)
    1.37 +  {
    1.38 +  }
    1.39 +
    1.40 +// Assertion failure: !pn->isPlaceholder(), at ../jsparse.cpp:4876
    1.41 +// =====
    1.42 +  (function(){ var x; eval("var x; x = null"); })();
    1.43 +
    1.44 +// Assertion failure: !(pnu->pn_dflags & PND_BOUND), at ../jsemit.cpp:1818
    1.45 +// =====
    1.46 +  (function(){const x = 0, y = delete x;})()
    1.47 +
    1.48 +// Assertion failure: JOF_OPTYPE(op) == JOF_ATOM, at ../jsemit.cpp:1710
    1.49 +// =====
    1.50 +    try
    1.51 +    {
    1.52 +      (function(){(yield []) (function(){with({}){x} }); const x;})();
    1.53 +    }
    1.54 +    catch(ex)
    1.55 +    {
    1.56 +    }
    1.57 +
    1.58 +// Assertion failure: cg->upvars.lookup(atom), at ../jsemit.cpp:2022
    1.59 +// =====
    1.60 +  try
    1.61 +  {
    1.62 +    (function(){([]) ((function(q) { return q; })for (each in [1,2]))})();
    1.63 +  }
    1.64 +  catch(ex)
    1.65 +  {
    1.66 +  }
    1.67 +// Assertion failure: lexdep->frameLevel() <= funbox->level, at ../jsparse.cpp:1782
    1.68 +// Opt crash [@ JSCompiler::setFunctionKinds] near null
    1.69 +// =====
    1.70 +
    1.71 +  try
    1.72 +  {
    1.73 +    eval("((x1) > [(x)(function() { x;}) for each (x in x)])()");
    1.74 +  }
    1.75 +  catch(ex)
    1.76 +  {
    1.77 +  }
    1.78 +
    1.79 +// Assertion failure: pnu->pn_lexdef == dn, at ../jsemit.cpp:1817
    1.80 +// =====
    1.81 +  uneval(function(){for(var [arguments] = ({ get y(){} }) in y ) (x);});
    1.82 +
    1.83 +// Assertion failure: n != 0, at ../jsfun.cpp:2689
    1.84 +// =====
    1.85 +  try
    1.86 +  {
    1.87 +    eval('(function(){{for(c in (function (){ for(x in (x1))window} )()) {const x;} }})();');
    1.88 +  }
    1.89 +  catch(ex)
    1.90 +  {
    1.91 +  }
    1.92 +
    1.93 +// Assertion failure: op == JSOP_GETLOCAL, at ../jsemit.cpp:4557
    1.94 +// =====
    1.95 +  try
    1.96 +  {
    1.97 +    (eval("(function(){let x , x =  (x for (x in null))});"))();
    1.98 +  }
    1.99 +  catch(ex)
   1.100 +  {
   1.101 +  }
   1.102 +
   1.103 +// Assertion failure: (fun->u.i.script)->upvarsOffset != 0, at ../jsfun.cpp:1537
   1.104 +// Opt crash [@ js_NewFlatClosure] near null
   1.105 +// =====
   1.106 +  "" + function(){for(var [x] in x1) ([]); function x(){}}
   1.107 +
   1.108 +// Assertion failure: cg->stackDepth == stackDepth, at ../jsemit.cpp:3664
   1.109 +// Opt crash [@ JS_ArenaRealloc] near null
   1.110 +// =====
   1.111 +  try
   1.112 +  {
   1.113 +    eval(
   1.114 +      "for (a in (function(){" +
   1.115 +      "      for each (let x in ['']) { return new function x1 (\u3056) { yield x } ();" +
   1.116 +      "        }})())" +
   1.117 +      "  function(){}"
   1.118 +      );
   1.119 +  }
   1.120 +  catch(ex)
   1.121 +  {
   1.122 +  }
   1.123 +// Crash [@ js_Interpret] near null
   1.124 +// =====
   1.125 +
   1.126 +  reportCompare(expect, actual, summary);
   1.127 +
   1.128 +  exitFunc ('test');
   1.129 +}

mercurial