aboutsummaryrefslogtreecommitdiffstats
path: root/src/dstr-assignment/array-rest-iter-get-err.case
blob: 7693c779db139b1297f03f69030d1839555dc67f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Abrupt completion returned from GetIterator
info: |
    ArrayAssignmentPattern : [ Elisionopt AssignmentRestElement ]

    1. Let iterator be GetIterator(value).
    2. ReturnIfAbrupt(iterator).
features: [Symbol.iterator]
template: error
es6id: 12.14.5.2
esid: sec-runtime-semantics-destructuringassignmentevaluation
---*/

//- setup
var iterable = {};
var x;
iterable[Symbol.iterator] = function() {
  throw new Test262Error();
};
//- error
Test262Error
//- elems
[...x]
//- vals
iterable