| 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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 | var gTestfile = 'regress-452498-135.js'; |
| 7 | //----------------------------------------------------------------------------- |
| 8 | var BUGNUMBER = 452498; |
| 9 | var summary = 'TM: upvar2 regression tests'; |
| 10 | var actual = ''; |
| 11 | var expect = ''; |
| 12 | |
| 13 | |
| 14 | //----------------------------------------------------------------------------- |
| 15 | test(); |
| 16 | //----------------------------------------------------------------------------- |
| 17 | |
| 18 | function test() |
| 19 | { |
| 20 | enterFunc ('test'); |
| 21 | printBugNumber(BUGNUMBER); |
| 22 | printStatus (summary); |
| 23 | |
| 24 | // ------- Comment #135 From Gary Kwong [:nth10sd] |
| 25 | |
| 26 | // -j is not required: |
| 27 | // === |
| 28 | |
| 29 | for (let i = 0; i < 9; ++i) { |
| 30 | let m = i; |
| 31 | if (i % 3 == 1) { |
| 32 | print('' + (function() { return m; })()); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | // Assertion failure: fp2->fun && fp2->script, at ../jsinterp.cpp:5633 |
| 37 | // Opt crash [@ js_Interpret] |
| 38 | // === |
| 39 | |
| 40 | try |
| 41 | { |
| 42 | (x for each (c in [])) |
| 43 | x |
| 44 | } |
| 45 | catch(ex) |
| 46 | { |
| 47 | } |
| 48 | |
| 49 | // Assertion failure: dn_kind == JSDefinition::VAR || dn_kind == JSDefinition::CONST, at ../jsemit.cpp:2187 |
| 50 | |
| 51 | // === |
| 52 | "" + (function(){L:if (*::*){ var x } function x(){}}) |
| 53 | |
| 54 | // Assertion failure: slot < StackDepth(jp->script), at ../jsopcode.cpp:1329 |
| 55 | // === |
| 56 | "" + (function(){if (*::*){ var x } function x(){}}) |
| 57 | |
| 58 | // Assertion failure: (uintN)i < ss->top, at ../jsopcode.cpp:2825 |
| 59 | // === |
| 60 | "" + (function(){{<y/>; throw <z/>;for(var x = [] in false) return } function x(){}}) |
| 61 | |
| 62 | // Assertion failure: ss->printer->pcstack, at ../jsopcode.cpp:909 |
| 63 | // === |
| 64 | try |
| 65 | { |
| 66 | (function(){for(; (this); ((window for (x in [])) for (y in []))) 0}); |
| 67 | } |
| 68 | catch(ex) |
| 69 | { |
| 70 | } |
| 71 | // Assertion failure: level >= tc->staticLevel, at ../jsparse.cpp:5773 |
| 72 | // === |
| 73 | eval(uneval( function(){ |
| 74 | ((function()y)() for each (x in this)) |
| 75 | } )) |
| 76 | |
| 77 | // Debug & opt crash [@ BindNameToSlot] |
| 78 | |
| 79 | // -j is required: |
| 80 | // === |
| 81 | for (let a=0;a<3;++a) for (let b=0;b<3;++b) if ((g=a|(a%b))) with({}){} |
| 82 | |
| 83 | // Assertion failure: OBJ_IS_CLONED_BLOCK(obj), at ../jsobj.cpp:2392 |
| 84 | |
| 85 | reportCompare(expect, actual, summary); |
| 86 | |
| 87 | exitFunc ('test'); |
| 88 | } |