| throw new Error('Bad assertion'); |
| // Check spread ordering without Proxy |
| 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 }); |
| assert(calls[1] === 'z'); |
| assert(calls[2] === 'a'); |
| assert(calls[3] === 'Symbol(foo)'); |
| assert(Object.keys(obj).length === 3); |
| // Check spread ordering with Proxy |
| var fooSymbol = Symbol('foo'); |
| Object.defineProperty(o, 1, { value: 4, enumerable: true }); |
| Object.defineProperty(o, fooSymbol, { value: 5, enumerable: true }); |
| get: function(target, property, receiver) { |
| assert(calls[3] === fooSymbol); |
| assert(Object.keys(obj).length === 3); |