js/src/jit-test/tests/debug/Object-getOwnPropertyDescriptor-03.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 // obj.getOwnPropertyDescriptor works on global objects.
     3 var g = newGlobal();
     4 g.eval("var v; const k = 42;");
     5 this.eval("var v; const k = 42;");
     7 var dbg = Debugger();
     8 var obj = dbg.addDebuggee(g);
    10 function test(name) {
    11     var desc = obj.getOwnPropertyDescriptor(name);
    12     assertEq(desc instanceof Object, true);
    13     var expected = Object.getOwnPropertyDescriptor(this, name);
    14     assertEq(Object.prototype.toString.call(desc), Object.prototype.toString.call(expected));
    15     assertEq(desc.enumerable, expected.enumerable);
    16     assertEq(desc.configurable, expected.configurable);
    17     assertEq(desc.writable, expected.writable);
    18     assertEq(desc.value, expected.value);
    19 }
    21 test("Infinity");
    22 test("v");
    23 test("k");

mercurial