]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/js1_5/Regress/regress-68498-003.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 "AS
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 * 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. All
19 * Contributor(s): brendan@mozilla.org, pschwartau@netscape.com
22 * SUMMARY: calling obj.eval(str)
24 * See http://bugzilla.mozilla.org/show_bug.cgi?id=68498
25 * See http://bugzilla.mozilla.org/showattachment.cgi?attach_id=25251
29 * "Backward compatibility: support calling obj.eval(str), which evaluates
30 * str using obj as the scope chain and variable object."
32 //-------------------------------------------------------------------------------------------------
34 var summary
= 'Testing calling obj.eval(str)';
35 var statprefix
= '; currently at expect[';
36 var statsuffix
= '] within test -';
41 // Capture a reference to the global object -
44 // This function is the heart of the test -
45 function f(s
) {self
.eval(s
); return y
;}
48 // Set the actual-results array -
49 actual
[0] = f('var y = 43');
50 actual
[1] = 'y' in self
&& y
;
52 actual
[3] = 'y' in self
;
54 // Set the expected-results array -
61 //-------------------------------------------------------------------------------------------------
63 //-------------------------------------------------------------------------------------------------
70 printStatus (summary
);
74 reportCompare(expect
[i
], actual
[i
], getStatus(i
));
83 return (summary
+ statprefix
+ i
+ statsuffix
);