summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCaio Lima <ticaiolima@gmail.com>2017-09-26 18:02:42 -0300
committerRick Waldron <waldron.rick@gmail.com>2017-09-26 17:02:42 -0400
commitd41eb5d91352d1de5210c93d4d36633d6f731c81 (patch)
tree3480169c1f0cb5bca066de0c7ad3311f09ce017b /src
parentc9691531458bc199deabda31628cbf838f0e3986 (diff)
downloadqtdeclarative-testsuites-d41eb5d91352d1de5210c93d4d36633d6f731c81.tar.gz
Added test case to consider rest ordering (#1242)
Diffstat (limited to 'src')
-rw-r--r--src/dstr-assignment/obj-rest-order.case23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/dstr-assignment/obj-rest-order.case b/src/dstr-assignment/obj-rest-order.case
new file mode 100644
index 000000000..2448b1a18
--- /dev/null
+++ b/src/dstr-assignment/obj-rest-order.case
@@ -0,0 +1,23 @@
+// Copyright (C) 2017 Caio Lima. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+desc: Rest operation follows [[OwnPropertyKeys]] order
+template: default
+esid: pending
+includes: [compareArray.js]
+features: [Symbol, object-rest]
+---*/
+
+//- setup
+var rest;
+var calls = [];
+var o = { get z() { calls.push('z') }, get a() { calls.push('a') } };
+Object.defineProperty(o, 1, { get: () => { calls.push(1) }, enumerable: true });
+Object.defineProperty(o, Symbol('foo'), { get: () => { calls.push("Symbol(foo)") }, enumerable: true });
+//- elems
+{...rest}
+//- vals
+o
+//- body
+assert(compareArray(calls, [1, 'z', 'a', "Symbol(foo)"]));
+assert.sameValue(Object.keys(rest).length, 3);