js/src/jit-test/tests/for-of/bug-728079-js17-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.

     1 // for-of does not trigger the JS 1.7 for-in destructuring special case.
     3 version(170);
     5 var data = [[1, 2, 3], [4, 5, 6, 7]];
     7 function test(vars, expr, result) {
     8     var s = '';
     9     eval("for (" + vars + " of data) s += (" + expr + ") + ';';");
    10     assertEq(s, result);
    11 }
    13 for (var prefix of ["var ", "let ", ""]) {
    14     test(prefix + "[a, b, c]",
    15          "a + ',' + b + ',' + c",
    16          "1,2,3;4,5,6;");
    17 }
    19 test("var [a]", "a", "1;4;");
    20 test("var {length: len}", "len", "3;4;");
    21 test("var {length}", "length", "3;4;");
    22 test("{}", "0", "0;0;");

mercurial