js/src/jit-test/tests/debug/Object-getOwnPropertyNames-01.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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