js/src/tests/ecma_2/Exceptions/exception-006.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: 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/. */
     7 /**
     8  *  File Name:          exception-006
     9  *  ECMA Section:
    10  *  Description:        Tests for JavaScript Standard Exceptions
    11  *
    12  *  ToPrimitive error.
    13  *
    14  *  Author:             christine@netscape.com
    15  *  Date:               31 August 1998
    16  */
    17 var SECTION = "exception-006";
    18 var VERSION = "js1_4";
    19 var TITLE   = "Tests for JavaScript Standard Exceptions: TypeError";
    21 startTest();
    22 writeHeaderToLog( SECTION + " "+ TITLE);
    24 ToPrimitive_1();
    26 test();
    29 /**
    30  * Getting the [[DefaultValue]] of any instances of MyObject
    31  * should result in a runtime error in ToPrimitive.
    32  */
    34 function MyObject() {
    35   this.toString = void 0;
    36   this.valueOf = void 0;
    37 }
    39 function ToPrimitive_1() {
    40   result = "failed: no exception thrown";
    41   exception = null;
    43   try {
    44     result = new MyObject() + new MyObject();
    45   } catch ( e ) {
    46     result = "passed:  threw exception",
    47       exception = e.toString();
    48   } finally {
    49     new TestCase(
    50       SECTION,
    51       "new MyObject() + new MyObject() [ exception is " + exception +" ]",
    52       "passed:  threw exception",
    53       result );
    54   }
    55 }

mercurial