| 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-130.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 #130 From Gary Kwong [:nth10sd] |
| 25 | |
| 26 | // Does not require -j: |
| 27 | // ===== |
| 28 | ((function x()x in []) for (y in [])) |
| 29 | |
| 30 | //Assertion failure: lexdep->frameLevel() <= funbox->level, at ../jsparse.cpp:1778 |
| 31 | // Opt crash [@ JSCompiler::setFunctionKinds] |
| 32 | // ===== |
| 33 | let(x=[]) function(){try {x} catch(x) {} } |
| 34 | |
| 35 | // Assertion failure: cg->upvars.lookup(atom), at ../jsemit.cpp:2034 |
| 36 | // ===== |
| 37 | try |
| 38 | { |
| 39 | eval('for(let [y] = (let (x) (y)) in []) function(){}'); |
| 40 | } |
| 41 | catch(ex) |
| 42 | { |
| 43 | } |
| 44 | // Assertion failure: !(pnu->pn_dflags & PND_BOUND), at ../jsemit.cpp:1818 |
| 45 | // ===== |
| 46 | |
| 47 | |
| 48 | // Requires -j: |
| 49 | // ===== |
| 50 | for (var x = 0; x < 3; ++x) { new function(){} } |
| 51 | |
| 52 | // Assertion failure: cx->bailExit, at ../jstracer.cpp:4672 |
| 53 | // Opt crash [@ LeaveTree] near null |
| 54 | |
| 55 | reportCompare(expect, actual, summary); |
| 56 | |
| 57 | exitFunc ('test'); |
| 58 | } |