summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/object/property-descriptor-order.js
blob: 337d247daee22f63aa7d2eb0ae767ef2dc9fd8d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var names = Object.getOwnPropertyNames(Object.getOwnPropertyDescriptor({foo: 0}, "foo"));
assertDeepEq(names, ["value", "writable", "enumerable", "configurable"]);

names = Object.getOwnPropertyNames(Object.getOwnPropertyDescriptor({get foo(){}}, "foo"));
assertDeepEq(names, ["get", "set", "enumerable", "configurable"]);

var proxy = new Proxy({}, {
    defineProperty(target, key, desc) {
        var names = Object.getOwnPropertyNames(desc);
        assertDeepEq(names, ["set", "configurable"]);
        return true;
    }
});

Object.defineProperty(proxy, "foo", {configurable: true, set: function() {}});

reportCompare(true, true);