| 1 |
// Copyright 2015 Cubane Canada, Inc. All rights reserved. |
| 2 |
// See LICENSE for details. |
| 3 |
|
| 4 |
/*--- |
| 5 |
info: | |
| 6 |
Generator can be declared with GeneratorExpression syntax |
| 7 |
es6id: 14.4 |
| 8 |
author: Sam Mikes |
| 9 |
description: can create generator function expressions (no name) |
| 10 |
features: [generators] |
| 11 |
---*/ |
| 12 |
|
| 13 |
var a = [function *(a) { yield a+1; return; }]; |
| 14 |
var f = a[0]; |
| 15 |
|
| 16 |
assert.sameValue(f.name, ''); |
| 17 |
|
| 18 |
var g = f(3); |
| 19 |
|
| 20 |
assert.sameValue(g.next().value, 4); |
| 21 |
assert.sameValue(g.next().done, true); |