js/src/tests/js1_5/Regress/regress-170193.js

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:ce422b6df48c
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 *
8 * Date: 22 Sep 2002
9 * SUMMARY: adding prop after middle-delete of function w duplicate formal args
10 * See http://bugzilla.mozilla.org/show_bug.cgi?id=170193
11 *
12 */
13 //-----------------------------------------------------------------------------
14 var UBound = 0;
15 var BUGNUMBER = 170193;
16 var summary = 'adding property after middle-delete of function w duplicate formal args';
17 var status = '';
18 var statusitems = [];
19 var actual = '';
20 var actualvalues = [];
21 var expect= '';
22 var expectedvalues = [];
23
24 /*
25 * This sequence of steps used to cause the SpiderMonkey shell to hang -
26 */
27 function f(a,a,b){}
28 f.c=42;
29 f.d=43;
30 delete f.c; // "middle delete"
31 f.e=44;
32
33 status = inSection(1);
34 actual = f.c;
35 expect = undefined;
36 addThis();
37
38 status = inSection(2);
39 actual = f.d;
40 expect = 43;
41 addThis();
42
43 status = inSection(3);
44 actual = f.e;
45 expect = 44;
46 addThis();
47
48
49
50 //-----------------------------------------------------------------------------
51 test();
52 //-----------------------------------------------------------------------------
53
54
55
56 function addThis()
57 {
58 statusitems[UBound] = status;
59 actualvalues[UBound] = actual;
60 expectedvalues[UBound] = expect;
61 UBound++;
62 }
63
64
65 function test()
66 {
67 enterFunc('test');
68 printBugNumber(BUGNUMBER);
69 printStatus(summary);
70
71 for (var i=0; i<UBound; i++)
72 {
73 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
74 }
75
76 exitFunc ('test');
77 }

mercurial