Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Object / assign / source-own-prop-keys-error.js
blob5cad1fbda1f48f3627d5548bac4d6ab13d1e8759
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 ---*/
18 var source = new Proxy({}, {
19   ownKeys: function() {
20     throw new Test262Error();
21   }
22 });
24 assert.throws(Test262Error, function() {
25   Object.assign({}, source);
26 });
28 reportCompare(0, 0);