js/src/tests/js1_8_1/strict/generator-eval-arguments.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 // |reftest| skip-if(Android)
     2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     4 /*
     5  * Any copyright is dedicated to the Public Domain.
     6  * http://creativecommons.org/licenses/publicdomain/
     7  */
     9 /*
    10  * In strict mode, generator expressions may not locally bind 'eval'
    11  * or 'arguments.'
    12  */
    13 assertEq(testLenientAndStrict('(1 for (eval in []))',
    14                               parsesSuccessfully,
    15                               parseRaisesException(SyntaxError)),
    16          true);
    17 assertEq(testLenientAndStrict('(1 for ([eval] in []))',
    18                               parsesSuccessfully,
    19                               parseRaisesException(SyntaxError)),
    20          true);
    21 assertEq(testLenientAndStrict('(1 for ({x:eval} in []))',
    22                               parsesSuccessfully,
    23                               parseRaisesException(SyntaxError)),
    24          true);
    25 assertEq(testLenientAndStrict('(1 for (arguments in []))',
    26                               parsesSuccessfully,
    27                               parseRaisesException(SyntaxError)),
    28          true);
    29 assertEq(testLenientAndStrict('(1 for ([arguments] in []))',
    30                               parsesSuccessfully,
    31                               parseRaisesException(SyntaxError)),
    32          true);
    33 assertEq(testLenientAndStrict('(1 for ({x:arguments} in []))',
    34                               parsesSuccessfully,
    35                               parseRaisesException(SyntaxError)),
    36          true);
    38 reportCompare(true, true);

mercurial