js/src/tests/ecma_5/Expressions/named-accessor-function.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 // Any copyright is dedicated to the Public Domain.
     2 // http://creativecommons.org/licenses/publicdomain/
     3 // Contributor:
     4 //   Jeff Walden <jwalden+code@mit.edu>
     6 //-----------------------------------------------------------------------------
     7 var BUGNUMBER = 999999;
     8 var summary = '{ get x y() { } } is not valid getter syntax';
    10 print(BUGNUMBER + ": " + summary);
    12 var BAD_CODE = ["({ get x y() { } })", "({ set x y(v) { } })"];
    14 for (var i = 0, sz = BAD_CODE.length; i < sz; i++)
    15 {
    16   var code = BAD_CODE[i];
    18   var err = "no exception";
    19   try
    20   {
    21     eval(code);
    22   }
    23   catch (e)
    24   {
    25     err = e;
    26   }
    27   if (!(err instanceof SyntaxError))
    28   {
    29     assertEq(true, false,
    30              "bad or no exception thrown for eval(" + code + "): " + err);
    31   }
    33   err = "no exception";
    34   try
    35   {
    36     new Function(code);
    37   }
    38   catch (e)
    39   {
    40     err = e;
    41   }
    42   if (!(err instanceof SyntaxError))
    43   {
    44     assertEq(true, false,
    45              "bad or no exception thrown for Function(" + code + "): " + err);
    46   }
    47 }
    49 reportCompare(true, true);

mercurial