js/src/jit-test/tests/basic/metadata-hook.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.

     2 x = [1,2,3];
     3 setObjectMetadata(x, {y:0});
     4 assertEq(getObjectMetadata(x).y, 0);
     6 setObjectMetadataCallback(true);
     8 function Foo() {
     9   this.x = 0;
    10   this.y = 1;
    11 }
    13 function hello() {
    14   function there() {
    15     w = new Foo();
    16     x = [1,2,3];
    17     y = [2,3,5];
    18     z = {a:0,b:1};
    19   }
    20   callee = there;
    21   callee();
    22 }
    23 hello();
    25 var wc = getObjectMetadata(w).index;
    26 var xc = getObjectMetadata(x).index;
    27 var yc = getObjectMetadata(y).index;
    28 var zc = getObjectMetadata(z).index;
    30 assertEq(xc > wc, true);
    31 assertEq(yc > xc, true);
    32 assertEq(zc > yc, true);
    33 assertEq(getObjectMetadata(x).stack[0], callee);
    34 assertEq(getObjectMetadata(x).stack[1], hello);

mercurial