keith_miller@apple.com | bcc77f2 | 2016-07-15 06:03:25 +0000 | [diff] [blame] | 1 | // Copyright (C) 2015 the V8 project authors. All rights reserved. |
| 2 | // This code is governed by the BSD license found in the LICENSE file. |
| 3 | /*--- |
| 4 | es6id: 19.1.2.1 |
| 5 | description: Invoked with a source whose own property keys cannot be retrieved |
| 6 | info: > |
| 7 | [...] |
| 8 | 5. For each element nextSource of sources, in ascending index order, |
| 9 | a. If nextSource is undefined or null, let keys be an empty List. |
| 10 | b. Else, |
| 11 | i. Let from be ToObject(nextSource). |
| 12 | ii. ReturnIfAbrupt(from). |
| 13 | iii. Let keys be from.[[OwnPropertyKeys]](). |
| 14 | iv. ReturnIfAbrupt(keys). |
| 15 | features: [Proxy] |
| 16 | ---*/ |
| 17 | |
| 18 | var source = new Proxy({}, { |
| 19 | ownKeys: function() { |
| 20 | throw new Test262Error(); |
| 21 | } |
| 22 | }); |
| 23 | |
| 24 | assert.throws(Test262Error, function() { |
| 25 | Object.assign({}, source); |
| 26 | }); |