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.

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

mercurial