js/src/tests/ecma_3/ExecutionContexts/10.1.4-1.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.

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     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/. */
     7 /**
     8    ECMA Section: 10.1.4.1 Entering An Execution Context
     9    ECMA says:
    10    * Global Code, Function Code
    11    Variable instantiation is performed using the global object as the
    12    variable object and using property attributes { DontDelete }.
    14    * Eval Code
    15    Variable instantiation is performed using the calling context's
    16    variable object and using empty property attributes.
    17 */
    19 var BUGNUMBER = '(none)';
    20 var summary = '10.1.4.1 Entering An Execution Context';
    21 var actual = '';
    22 var expect = '';
    24 test();
    26 function test()
    27 {
    28   enterFunc ("test");
    29   printBugNumber(BUGNUMBER);
    30   printStatus (summary);
    32   var y;
    33   eval("var x = 1");
    35   if (delete y)
    36     reportCompare('PASS', 'FAIL', "Expected *NOT* to be able to delete y");
    38   if (typeof x == "undefined")
    39     reportCompare('PASS', 'FAIL', "x did not remain defined after eval()");
    40   else if (x != 1)
    41     reportCompare('PASS', 'FAIL', "x did not retain it's value after eval()");
    43   if (!delete x)
    44     reportCompare('PASS', 'FAIL', "Expected to be able to delete x");
    46   reportCompare('PASS', 'PASS', '10.1.4.1 Entering An Execution Context');
    48   exitFunc("test");       
    49 }

mercurial