Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-170193.js

raw symbols SCIP
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 gTestfile = 'regress-170193.js';
15 var UBound = 0;
16 var BUGNUMBER = 170193;
17 var summary = 'adding property after middle-delete of function w duplicate formal args';
18 var status = '';
19 var statusitems = [];
20 var actual = '';
21 var actualvalues = [];
22 var expect= '';
23 var expectedvalues = [];
24
25 /*
26 * This sequence of steps used to cause the SpiderMonkey shell to hang -
27 */
28 function f(a,a,b){}
29 f.c=42;
30 f.d=43;
31 delete f.c; // "middle delete"
32 f.e=44;
33
34 status = inSection(1);
35 actual = f.c;
36 expect = undefined;
37 addThis();
38
39 status = inSection(2);
40 actual = f.d;
41 expect = 43;
42 addThis();
43
44 status = inSection(3);
45 actual = f.e;
46 expect = 44;
47 addThis();
48
49
50
51 //-----------------------------------------------------------------------------
52 test();
53 //-----------------------------------------------------------------------------
54
55
56
57 function addThis()
58 {
59 statusitems[UBound] = status;
60 actualvalues[UBound] = actual;
61 expectedvalues[UBound] = expect;
62 UBound++;
63 }
64
65
66 function test()
67 {
68 enterFunc('test');
69 printBugNumber(BUGNUMBER);
70 printStatus(summary);
71
72 for (var i=0; i<UBound; i++)
73 {
74 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
75 }
76
77 exitFunc ('test');
78 }