js/src/tests/ecma_5/Expressions/11.1.5-01.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/
     4 //-----------------------------------------------------------------------------
     5 var BUGNUMBER = 520696;
     6 var summary =
     7   'Implement support for string literals as names for properties defined ' +
     8   'using ES5 get/set syntax';
    10 print(BUGNUMBER + ": " + summary);
    13 var o;
    15 o = { get "a b c"() { return 17; } };
    16 assertEq("get" in Object.getOwnPropertyDescriptor(o, "a b c"), true);
    18 o = eval('({ get "a b c"() { return 17; } })');
    19 assertEq("get" in Object.getOwnPropertyDescriptor(o, "a b c"), true);
    21 var f = eval("(function literalInside() { return { set 'c d e'(q) { } }; })");
    22 f = function literalInside() { return { set 'c d e'(q) { } }; };
    24 function checkO()
    25 {
    26   assertEq(3.141592654 in o, true, "fractional-named property isn't in object");
    27   assertEq(10000 in o, true, "exponential-named property is in object");
    28   assertEq(0xdeadbeef in o, true, "hex-named property is in object");
    29   assertEq("Infinity" in o, true, "numeric index stringified correctly");
    30 }
    32 o = eval('({ 3.141592654: "pi", 1e4: 17, 0xdeadbeef: "hex", 1e3000: "Infinity" })');
    33 checkO();
    34 o = { 3.141592654: "pi", 1e4: 17, 0xdeadbeef: "hex", 1e3000: "Infinity" };
    35 checkO();
    37 reportCompare(true, true);

mercurial