| 1 |
// Copyright (C) 2013 the V8 project authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
description: > |
| 6 |
Newlines terminate `yield` expressions. |
| 7 |
es6id: 14.4 |
| 8 |
features: [generators] |
| 9 |
---*/ |
| 10 |
|
| 11 |
var iter, result; |
| 12 |
var g = function*() { |
| 13 |
yield |
| 14 |
1 |
| 15 |
}; |
| 16 |
|
| 17 |
iter = g(); |
| 18 |
|
| 19 |
result = iter.next(); |
| 20 |
assert.sameValue(result.value, undefined, 'First result `value`'); |
| 21 |
assert.sameValue(result.done, false, 'First result `done` flag'); |
| 22 |
|
| 23 |
result = iter.next(); |
| 24 |
assert.sameValue(result.value, undefined, 'Second result `value`'); |
| 25 |
assert.sameValue(result.done, true, 'Second result `done` flag'); |