Debian Codegraph @

rhino/testsrc/tests/ecma_3/Function/regress-137181.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: 12 Apr 2002
9 * SUMMARY: delete arguments[i] should break connection to local reference
10 *
11 * See http://bugzilla.mozilla.org/show_bug.cgi?id=137181
12 *
13 */
14 //-----------------------------------------------------------------------------
15 var gTestfile = 'regress-137181.js';
16 var UBound = 0;
17 var BUGNUMBER = 137181;
18 var summary = 'delete arguments[i] should break connection to local reference';
19 var status = '';
20 var statusitems = [];
21 var actual = '';
22 var actualvalues = [];
23 var expect= '';
24 var expectedvalues = [];
25
26
27 status = inSection(1);
28 function f1(x)
29 {
30 x = 1;
31 delete arguments[0];
32 return x;
33 }
34 actual = f1(0); // (bug: Rhino was returning |undefined|)
35 expect = 1;
36 addThis();
37
38
39 status = inSection(2);
40 function f2(x)
41 {
42 x = 1;
43 delete arguments[0];
44 arguments[0] = -1;
45 return x;
46 }
47 actual = f2(0); // (bug: Rhino was returning -1)
48 expect = 1;
49 addThis();
50
51
52
53 //-----------------------------------------------------------------------------
54 test();
55 //-----------------------------------------------------------------------------
56
57
58
59 function addThis()
60 {
61 statusitems[UBound] = status;
62 actualvalues[UBound] = actual;
63 expectedvalues[UBound] = expect;
64 UBound++;
65 }
66
67
68 function test()
69 {
70 enterFunc('test');
71 printBugNumber(BUGNUMBER);
72 printStatus(summary);
73
74 for (var i=0; i<UBound; i++)
75 {
76 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
77 }
78
79 exitFunc ('test');
80 }