Wed, 31 Dec 2014 07:53:36 +0100
Correct small whitespace inconsistency, lost while renaming variables.
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/. */
6 //-----------------------------------------------------------------------------
7 var BUGNUMBER = 452498;
8 var summary = 'TM: upvar2 regression tests';
9 var actual = '';
10 var expect = '';
13 //-----------------------------------------------------------------------------
14 test();
15 //-----------------------------------------------------------------------------
17 function test()
18 {
19 enterFunc ('test');
20 printBugNumber(BUGNUMBER);
21 printStatus (summary);
23 // ------- Comment #117 From Gary Kwong [:nth10sd]
25 // The following all do not require -j.
27 // =====
29 try
30 {
31 eval('x; function x(){}; const x;');
32 }
33 catch(ex)
34 {
35 }
37 // Assertion failure: !pn->isPlaceholder(), at ../jsparse.cpp:4876
38 // =====
39 (function(){ var x; eval("var x; x = null"); })();
41 // Assertion failure: !(pnu->pn_dflags & PND_BOUND), at ../jsemit.cpp:1818
42 // =====
43 (function(){const x = 0, y = delete x;})()
45 // Assertion failure: JOF_OPTYPE(op) == JOF_ATOM, at ../jsemit.cpp:1710
46 // =====
47 try
48 {
49 (function(){(yield []) (function(){with({}){x} }); const x;})();
50 }
51 catch(ex)
52 {
53 }
55 // Assertion failure: cg->upvars.lookup(atom), at ../jsemit.cpp:2022
56 // =====
57 try
58 {
59 (function(){([]) ((function(q) { return q; })for (each in [1,2]))})();
60 }
61 catch(ex)
62 {
63 }
64 // Assertion failure: lexdep->frameLevel() <= funbox->level, at ../jsparse.cpp:1782
65 // Opt crash [@ JSCompiler::setFunctionKinds] near null
66 // =====
68 try
69 {
70 eval("((x1) > [(x)(function() { x;}) for each (x in x)])()");
71 }
72 catch(ex)
73 {
74 }
76 // Assertion failure: pnu->pn_lexdef == dn, at ../jsemit.cpp:1817
77 // =====
78 uneval(function(){for(var [arguments] = ({ get y(){} }) in y ) (x);});
80 // Assertion failure: n != 0, at ../jsfun.cpp:2689
81 // =====
82 try
83 {
84 eval('(function(){{for(c in (function (){ for(x in (x1))window} )()) {const x;} }})();');
85 }
86 catch(ex)
87 {
88 }
90 // Assertion failure: op == JSOP_GETLOCAL, at ../jsemit.cpp:4557
91 // =====
92 try
93 {
94 (eval("(function(){let x , x = (x for (x in null))});"))();
95 }
96 catch(ex)
97 {
98 }
100 // Assertion failure: (fun->u.i.script)->upvarsOffset != 0, at ../jsfun.cpp:1537
101 // Opt crash [@ js_NewFlatClosure] near null
102 // =====
103 "" + function(){for(var [x] in x1) ([]); function x(){}}
105 // Assertion failure: cg->stackDepth == stackDepth, at ../jsemit.cpp:3664
106 // Opt crash [@ JS_ArenaRealloc] near null
107 // =====
108 try
109 {
110 eval(
111 "for (a in (function(){" +
112 " for each (let x in ['']) { return new function x1 (\u3056) { yield x } ();" +
113 " }})())" +
114 " function(){}"
115 );
116 }
117 catch(ex)
118 {
119 }
120 // Crash [@ js_Interpret] near null
121 // =====
123 reportCompare(expect, actual, summary);
125 exitFunc ('test');
126 }