regress-452498-117.js (1973B)
1 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 //----------------------------------------------------------------------------- 7 var BUGNUMBER = 452498; 8 var summary = 'TM: upvar2 regression tests'; 9 var actual = ''; 10 var expect = ''; 11 12 13 //----------------------------------------------------------------------------- 14 test(); 15 //----------------------------------------------------------------------------- 16 17 function test() 18 { 19 printBugNumber(BUGNUMBER); 20 printStatus (summary); 21 22 // ------- Comment #117 From Gary Kwong [:nth10sd] 23 24 // The following all do not require -j. 25 26 // ===== 27 28 try 29 { 30 eval('x; function x(){}; const x = undefined;'); 31 } 32 catch(ex) 33 { 34 } 35 36 // Assertion failure: !pn->isPlaceholder(), at ../jsparse.cpp:4876 37 // ===== 38 (function(){ var x; eval("var x; x = null"); })(); 39 40 // Assertion failure: !(pnu->pn_dflags & PND_BOUND), at ../jsemit.cpp:1818 41 // ===== 42 (function(){const x = 0, y = delete x;})() 43 44 // Assertion failure: n != 0, at ../jsfun.cpp:2689 45 // ===== 46 try 47 { 48 eval('(function(){{for(c in (function (){ for(x in (x1))window} )()) {const x = undefined;} }})();'); 49 } 50 catch(ex) 51 { 52 } 53 54 // Assertion failure: (fun->u.i.script)->upvarsOffset != 0, at ../jsfun.cpp:1537 55 // Opt crash [@ js_NewFlatClosure] near null 56 // ===== 57 "" + function(){for(var [x] in x1) ([]); function x(){}} 58 59 // Assertion failure: cg->stackDepth == stackDepth, at ../jsemit.cpp:3664 60 // Opt crash [@ JS_ArenaRealloc] near null 61 // ===== 62 try 63 { 64 eval( 65 "for (a in (function(){" + 66 " for (let x of ['']) { return new function x1 (\u3056) { yield x } ();" + 67 " }})())" + 68 " function(){}" 69 ); 70 } 71 catch(ex) 72 { 73 } 74 // Crash [@ js_Interpret] near null 75 // ===== 76 77 reportCompare(expect, actual, summary); 78 }