2 * The contents of this file are subject to the Netscape Public
3 * License Version 1.1 (the "License"); you may not use this file
4 * except in compliance with the License. You may obtain a copy of
5 * the License at http://www.mozilla.org/NPL/
7 * Software distributed under the License is distributed on an
8 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed
9 * or implied. See the License for the specific language governing
10 * rights and limitations under the License.
12 * The Original Code is mozilla.org code.
14 * The Initial Developer of the Original Code is Netscape
15 * Communications Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation.
17 * All Rights Reserved.
19 * Contributor(s): pschwartau@netscape.com
22 * SUMMARY: Testing visiblity of variables from within a with block.
23 * See http://bugzilla.mozilla.org/show_bug.cgi?id=90325
25 //-------------------------------------------------------------------------------------------------
28 var summary = 'Testing visiblity of variables from within a with block';
32 var actualvalues = [];
34 var expectedvalues = [];
36 // (compare local definitions which follow) -
42 // an object with 'C' and 'D' properties -
43 var objTEST = new Object();
48 status = 'Section 1 of test';
57 status = 'Section 2 of test';
66 status = 'Section 3 of test';
75 status = 'Section 4 of test';
79 status = 'Section 5 of test';
83 status = 'Section 6 of test';
87 status = 'Section 7 of test';
91 status = 'Section 8 of test';
92 localC.apply(new Object());
95 status = 'Section 9 of test';
96 localC.apply(new Object(), [objTEST]);
99 status = 'Section 10 of test';
100 localC.apply(objTEST, [objTEST]);
103 status = 'Section 11 of test';
104 localD(new Object());
107 status = 'Section 12 of test';
108 localD.apply(new Object(), [objTEST]);
111 status = 'Section 13 of test';
112 localD.apply(objTEST, [objTEST]);
117 //-------------------------------------------------------------------------------------------------
119 //-------------------------------------------------------------------------------------------------
123 // contains a with(new Object()) block -
136 // contains a with(Number) block -
149 // contains a with(this) block -
166 // contains a with(obj) block -
185 statusitems[UBound] = status;
186 actualvalues[UBound] = actual;
187 expectedvalues[UBound] = expect;
195 printBugNumber (bug);
196 printStatus (summary);
198 for (var i = 0; i < UBound; i++)
200 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);