| // Copyright (C) 2015 the V8 project authors. All rights reserved. |
| // This code is governed by the BSD license found in the LICENSE file. |
| If the left-hand side is not a lexical binding and the assignment produces |
| an error, the iterator should be closed and the error forwarded to the |
| features: [Symbol.iterator] |
| throw new Test262Error(); |
| iterable[Symbol.iterator] = function() { |
| return { done: false, value: 0 }; |
| assert.throws(Test262Error, function() { |
| for (x.attr of iterable) { |
| assert.sameValue(iterationCount, 0, 'The loop body is not evaluated'); |
| assert.sameValue(callCount, 1, 'Iterator is closed'); |