| // 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); |