|
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 //----------------------------------------------------------------------------- |
|
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 enterFunc ('test'); |
|
20 printBugNumber(BUGNUMBER); |
|
21 printStatus (summary); |
|
22 |
|
23 // ------- Comment #102 From Gary Kwong [:nth10sd] |
|
24 |
|
25 // ===== |
|
26 |
|
27 (function(){function x(){} function x()y})(); |
|
28 |
|
29 // Assertion failure: JOF_OPTYPE(op) == JOF_ATOM, at ../jsemit.cpp:1710 |
|
30 |
|
31 // ===== |
|
32 function f() { |
|
33 "" + (function(){ |
|
34 for( ; [function(){}] ; x = 0) |
|
35 with({x: ""}) |
|
36 const x = [] |
|
37 }); |
|
38 } |
|
39 f(); |
|
40 |
|
41 // Assertion failure: ss->top - saveTop <= 1U, at ../jsopcode.cpp:2156 |
|
42 |
|
43 // ===== |
|
44 |
|
45 try |
|
46 { |
|
47 function f() { |
|
48 var x; |
|
49 eval("const x = [];"); |
|
50 } |
|
51 f(); |
|
52 } |
|
53 catch(ex) |
|
54 { |
|
55 } |
|
56 // Assertion failure: regs.sp == StackBase(fp), at ../jsinterp.cpp:2984 |
|
57 |
|
58 // ===== |
|
59 try |
|
60 { |
|
61 do {x} while([[] for (x in []) ]); |
|
62 } |
|
63 catch(ex) |
|
64 { |
|
65 } |
|
66 // Assertion failure: !(pnu->pn_dflags & PND_BOUND), at ../jsemit.cpp:1818 |
|
67 // ===== |
|
68 |
|
69 try |
|
70 { |
|
71 {x} ((x=[] for (x in []))); x; |
|
72 } |
|
73 catch(ex) |
|
74 { |
|
75 } |
|
76 // Assertion failure: cg->staticLevel >= level, at ../jsemit.cpp:2014 |
|
77 // Crash [@ BindNameToSlot] in opt without -j |
|
78 |
|
79 // ===== |
|
80 |
|
81 reportCompare(expect, actual, summary); |
|
82 |
|
83 exitFunc ('test'); |
|
84 } |
|
85 |
|
86 |
|
87 |