Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Object / assign / source-own-prop-error.js
blob0229bd3354bc63760e46e3355a105e72fa8b2089
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 descriptor cannot be retrieved
6 info: |
7     [...]
8     5. For each element nextSource of sources, in ascending index order,
9        [...]
10        c. Repeat for each element nextKey of keys in List order,
11           i. Let desc be from.[[GetOwnProperty]](nextKey).
12           ii. ReturnIfAbrupt(desc).
13 features: [Proxy]
14 ---*/
16 var source = new Proxy({
17   attr: null
18 }, {
19   getOwnPropertyDescriptor: function() {
20     throw new Test262Error();
21   }
22 });
24 assert.throws(Test262Error, function() {
25   Object.assign({}, source);
26 });
28 reportCompare(0, 0);