js/src/tests/js1_4/Eval/eval-001.js

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:55fac8ca5127
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 * File Name: eval-001.js
9 * Original Description: (SEE REVISED DESCRIPTION FURTHER BELOW)
10 *
11 * The global eval function may not be accessed indirectly and then called.
12 * This feature will continue to work in JavaScript 1.3 but will result in an
13 * error in JavaScript 1.4. This restriction is also in place for the With and
14 * Closure constructors.
15 *
16 * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=324451
17 *
18 * Author: christine@netscape.com
19 * Date: 11 August 1998
20 *
21 *
22 * REVISION: 05 February 2001
23 * Author: pschwartau@netscape.com
24 *
25 * Indirect eval IS NOT ILLEGAL per ECMA3!!! See
26 *
27 * http://bugzilla.mozilla.org/show_bug.cgi?id=38512
28 *
29 * ------- Additional Comments From Brendan Eich 2001-01-30 17:12 -------
30 * ECMA-262 Edition 3 doesn't require implementations to throw EvalError,
31 * see the short, section-less Chapter 16. It does say an implementation that
32 * doesn't throw EvalError must allow assignment to eval and indirect calls
33 * of the evalnative method.
34 *
35 */
36 var SECTION = "eval-001.js";
37 var VERSION = "JS1_4";
38 var TITLE = "Calling eval indirectly should NOT fail in version 140";
39 var BUGNUMBER="38512";
40
41 startTest();
42 writeHeaderToLog( SECTION + " "+ TITLE);
43
44 var MY_EVAL = eval;
45 var RESULT = "";
46 var EXPECT = "abcdefg";
47
48 MY_EVAL( "RESULT = EXPECT" );
49
50 new TestCase(
51 SECTION,
52 "Call eval indirectly",
53 EXPECT,
54 RESULT );
55
56 test();
57

mercurial