js/src/jit-test/tests/jaeger/recompile/bug651119.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 Object.extend = function(destination, source) {
     2     for (var property in source)
     3         destination[property] = source[property];
     4 };
     5 var Enumerable = {
     6     _each: function(iterator) {
     7         for (var i = 0, length = this.length; i < length; i++)
     8             iterator(this[i]);
     9     },
    10     each: function(iterator, context) {
    11         var index = 0;
    12         this._each(function(value) {
    13             iterator.call(context, value, index++);
    14         });
    15     },
    16     map: function(iterator, context) {
    17         var results = [];
    18         this.each(function(value, index) {
    19             var res = iterator.call(context, value);
    20             results.push(res);
    21         });
    22         return results;
    23     },
    24     invoke: function(method) {
    25         var args = $A(arguments).slice(1);
    26         return this.map(function(value) {
    27             return value[method].apply(value, args);
    28         });
    29     },
    30 };
    31 Object.extend(Array.prototype, Enumerable);
    32 function $A(iterable) {
    33     var length = iterable.length || 0, results = new Array(length);
    34     while (length--) results[length] = iterable[length];
    35     return results;
    36 }
    37 function g() {
    38     return [1, 2, 3, 4, 5].each(function(part) {
    39         return 0;
    40     });
    41 }
    42 function f() {
    43     g();
    44     g();
    45     g();
    46     g();
    47     var result = [[2, 1, 3], [6, 5, 4]];    
    48     result = result.invoke('invoke', 'toString', 2);
    49     result[0].join(', ');
    50 };
    51 f();

mercurial