summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/object/property-descriptor-order.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/non262/object/property-descriptor-order.js')
-rw-r--r--js/src/tests/non262/object/property-descriptor-order.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/tests/non262/object/property-descriptor-order.js b/js/src/tests/non262/object/property-descriptor-order.js
new file mode 100644
index 0000000000..337d247dae
--- /dev/null
+++ b/js/src/tests/non262/object/property-descriptor-order.js
@@ -0,0 +1,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);