]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/js1_5/Scope/scope-002.js
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, crock@veilnetworks.com
22 * SUMMARY: Testing visibility of outer function from inner function.
25 //-------------------------------------------------------------------------------------------------
28 var summary
= 'Testing visibility of outer function from inner function';
29 var cnCousin
= 'Fred';
31 var cnMake
= 'Toyota';
35 var actualvalues
= [];
37 var expectedvalues
= [];
46 Outer
.cousin
= cnCousin
;
50 status
= 'Section 1 of test';
58 status
= 'Section 2 of test';
59 actual
= Outer
.cousin
;
69 Car
.prototype.paint
= paint
;
74 Car
.prototype.color
= Car
.color
;
79 var myCar
= new Car(cnMake
);
80 status
= 'Section 3 of test';
87 status
= 'Section 4 of test';
94 //--------------------------------------------------
96 //--------------------------------------------------
102 statusitems
[UBound
] = status
;
103 actualvalues
[UBound
] = actual
;
104 expectedvalues
[UBound
] = expect
;
112 printBugNumber (bug
);
113 printStatus (summary
);
115 for (var i
=0; i
<UBound
; i
++)
117 reportCompare(expectedvalues
[i
], actualvalues
[i
], statusitems
[i
]);