js/src/jit-test/tests/basic/testProxyConstructors.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 // |jit-test| error: ExitCleanly
     3 assertEq((new (Proxy.createFunction({},
     4                                     function(){ this.x = 1 },
     5                                     function(){ this.x = 2 }))).x, 2);
     6 try {
     7     x = Proxy.createFunction((function () {}), Uint16Array, wrap)
     8     new(wrap(x))
     9     throw "Should not be reached"
    10 }
    11 catch (e) {
    12     assertEq(String(e.message).indexOf('is not a constructor') === -1, false);
    13 }
    14 // proxies can return the callee
    15 var x = Proxy.createFunction({}, function (q) { return q; });
    16 assertEq(new x(x), x);
    17 try {
    18     var x = (Proxy.createFunction({}, "".indexOf));
    19     new x;
    20     throw "Should not be reached"
    21 }
    22 catch (e) {
    23     assertEq(String(e.message).indexOf('is not a constructor') === -1, false);
    24 }
    25 throw "ExitCleanly"

mercurial