mirror of
https://github.com/tc39/test262.git
synced 2025-07-13 17:14:38 +02:00
34 lines
858 B
Plaintext
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);
|