test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-get-err.case
Rick Waldron d4fde0a5c3 for-await-of: dstr-assignment, cases
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-05-17 15:31:50 -04:00

34 lines
858 B
Plaintext

// Copyright (C) 2017 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 :
[ AssignmentElementList , Elisionopt AssignmentRestElementopt ]
1. Let iterator be GetIterator(value).
2. ReturnIfAbrupt(iterator).
features: [Symbol.iterator]
template: async-generator
es6id: 12.14.5.2
esid: sec-runtime-semantics-destructuringassignmentevaluation
---*/
//- setup
let iterable = {
[Symbol.iterator]() {
throw new Test262Error();
}
};
let x;
//- elems
[ x , ]
//- vals
iterable
//- teardown
iter.return().then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
assert.sameValue(iterCount, 0);
assert.sameValue(constructor, Test262Error);
}).then($DONE, $DONE);