js/src/jit-test/tests/for-of/value-done-access.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 // Test that each yield* loop just checks "done", and "value" is only
     2 // fetched once at the end.
     4 load(libdir + 'iteration.js');
     6 var log = "";
     8 function Iter(val, count) {
     9     function next() {
    10         return {
    11             get done() { log += "d"; return count-- == 0; },
    12             get value() { log += "v"; return val; }
    13         }
    14     }
    16     this[std_iterator] = function() { return this; };
    17     this.next = next;
    18 }
    20 for (var x of new Iter(42, 5))
    21     assertEq(x, 42);
    23 assertEq(log, "dvdvdvdvdvd");

mercurial