js/src/tests/ecma_5/strict/11.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.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2
michael@0 3 /*
michael@0 4 * Any copyright is dedicated to the Public Domain.
michael@0 5 * http://creativecommons.org/licenses/publicdomain/
michael@0 6 */
michael@0 7
michael@0 8 /* Deleting an identifier is a syntax error in strict mode code only. */
michael@0 9 assertEq(testLenientAndStrict('delete x;',
michael@0 10 parsesSuccessfully,
michael@0 11 parseRaisesException(SyntaxError)),
michael@0 12 true);
michael@0 13
michael@0 14 /*
michael@0 15 * A reference expression surrounded by parens is itself a reference
michael@0 16 * expression.
michael@0 17 */
michael@0 18 assertEq(testLenientAndStrict('delete (x);',
michael@0 19 parsesSuccessfully,
michael@0 20 parseRaisesException(SyntaxError)),
michael@0 21 true);
michael@0 22
michael@0 23 /* Deleting other sorts of expressions are not syntax errors in either mode. */
michael@0 24 assertEq(testLenientAndStrict('delete x.y;',
michael@0 25 parsesSuccessfully,
michael@0 26 parsesSuccessfully),
michael@0 27 true);
michael@0 28 assertEq(testLenientAndStrict('delete Object();',
michael@0 29 returns(true),
michael@0 30 returns(true)),
michael@0 31 true);
michael@0 32
michael@0 33 /* Functions should inherit the surrounding code's strictness. */
michael@0 34 assertEq(testLenientAndStrict('function f() { delete x; }',
michael@0 35 parsesSuccessfully,
michael@0 36 parseRaisesException(SyntaxError)),
michael@0 37 true);
michael@0 38
michael@0 39 /* Local directives override the surrounding code's strictness. */
michael@0 40 assertEq(testLenientAndStrict('function f() { "use strict"; delete x; }',
michael@0 41 parseRaisesException(SyntaxError),
michael@0 42 parseRaisesException(SyntaxError)),
michael@0 43 true);
michael@0 44
michael@0 45 reportCompare(true, true);

mercurial