diff options
Diffstat (limited to 'deps/v8/test/mjsunit/harmony/generators-parsing.js')
-rw-r--r-- | deps/v8/test/mjsunit/harmony/generators-parsing.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/harmony/generators-parsing.js b/deps/v8/test/mjsunit/harmony/generators-parsing.js index 49a44ba32d..941fa202c2 100644 --- a/deps/v8/test/mjsunit/harmony/generators-parsing.js +++ b/deps/v8/test/mjsunit/harmony/generators-parsing.js @@ -38,6 +38,12 @@ function* g() { (yield 3) + (yield 4); } // You can have a generator in strict mode. function* g() { "use strict"; yield 3; yield 4; } +// Generators can have return statements also, which internally parse to a kind +// of yield expression. +function* g() { yield 1; return; } +function* g() { yield 1; return 2; } +function* g() { yield 1; return 2; yield "dead"; } + // Generator expression. (function* () { yield 3; }); |