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

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6
michael@0 7 /**
michael@0 8 * File Name: eval-002.js
michael@0 9 * Description: (SEE REVISED DESCRIPTION FURTHER BELOW)
michael@0 10 *
michael@0 11 * The global eval function may not be accessed indirectly and then called.
michael@0 12 * This feature will continue to work in JavaScript 1.3 but will result in an
michael@0 13 * error in JavaScript 1.4. This restriction is also in place for the With and
michael@0 14 * Closure constructors.
michael@0 15 *
michael@0 16 * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=324451
michael@0 17 *
michael@0 18 * Author: christine@netscape.com
michael@0 19 * Date: 11 August 1998
michael@0 20 *
michael@0 21 *
michael@0 22 * REVISION: 05 February 2001
michael@0 23 * Author: pschwartau@netscape.com
michael@0 24 *
michael@0 25 * Indirect eval IS NOT ILLEGAL per ECMA3!!! See
michael@0 26 *
michael@0 27 * http://bugzilla.mozilla.org/show_bug.cgi?id=38512
michael@0 28 *
michael@0 29 * ------- Additional Comments From Brendan Eich 2001-01-30 17:12 -------
michael@0 30 * ECMA-262 Edition 3 doesn't require implementations to throw EvalError,
michael@0 31 * see the short, section-less Chapter 16. It does say an implementation that
michael@0 32 * doesn't throw EvalError must allow assignment to eval and indirect calls
michael@0 33 * of the evalnative method.
michael@0 34 *
michael@0 35 */
michael@0 36 var SECTION = "eval-002.js";
michael@0 37 var VERSION = "JS1_4";
michael@0 38 var TITLE = "Calling eval indirectly should NOT fail in version 140";
michael@0 39 var BUGNUMBER="38512";
michael@0 40
michael@0 41 startTest();
michael@0 42 writeHeaderToLog( SECTION + " "+ TITLE);
michael@0 43
michael@0 44 var MY_EVAL = eval;
michael@0 45 var RESULT = "";
michael@0 46 var EXPECT = 1 + "testString"
michael@0 47
michael@0 48 EvalTest();
michael@0 49
michael@0 50 test();
michael@0 51
michael@0 52
michael@0 53 function EvalTest()
michael@0 54 {
michael@0 55 MY_EVAL( "RESULT = EXPECT" );
michael@0 56
michael@0 57 new TestCase(
michael@0 58 SECTION,
michael@0 59 "Call eval indirectly",
michael@0 60 EXPECT,
michael@0 61 RESULT );
michael@0 62 }
michael@0 63

mercurial