js/src/jit-test/tests/debug/Object-getOwnPropertyNames-01.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 // Basic getOwnPropertyNames tests.
     3 var g = newGlobal();
     4 var dbg = Debugger();
     5 var gobj = dbg.addDebuggee(g);
     7 function test(code) {
     8     code = "(" + code + ");";
     9     var expected = Object.getOwnPropertyNames(eval(code));
    10     g.eval("obj = " + code);
    11     var actual = gobj.getOwnPropertyDescriptor("obj").value.getOwnPropertyNames();
    12     assertEq(JSON.stringify(actual.sort()), JSON.stringify(expected.sort()));
    13 }
    15 test("{}");
    16 test("{a: 0, b: 1}");
    17 test("{'name with space': 0}");
    18 test("{get x() {}, set y(v) {}}");
    19 test("{get x() { throw 'fit'; }}");
    20 test("Object.create({a: 1})");
    21 test("Object.create({get a() {}, set a(v) {}})");
    22 test("(function () { var x = {a: 0, b: 1}; delete a; return x; })()");
    23 test("Object.create(null, {x: {value: 0}})");
    24 test("[]");
    25 test("[0, 1, 2]");
    26 test("[,,,,,]");
    27 test("/a*a/");
    28 test("function () {}");

mercurial