js/src/jit-test/tests/basic/new-bound-function.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 var funProto = Function.prototype;
     2 assertEq(Object.getOwnPropertyDescriptor(funProto, "prototype"), undefined);
     4 function Point(x, y) { this.x = x; this.y = y; }
     6 var YAxisPoint = Point.bind(null, 0);
     8 assertEq(YAxisPoint.prototype, undefined);
    10 var oldPoint;
    11 for (var i = 0, sz = 9; i < sz; oldPoint = point, i++)
    12 {
    13   var point = new YAxisPoint(5);
    14   assertEq(point === oldPoint, false);
    15   assertEq(point.x, 0);
    16   assertEq(point.y, 5);
    17   assertEq(Object.getOwnPropertyDescriptor(funProto, "prototype"), undefined);
    18   assertEq(Object.getOwnPropertyDescriptor(YAxisPoint, "prototype"), undefined);
    19 }

mercurial