Skip to content

Commit 44c5266

Browse files
committed
[New] add a generator function declaration
1 parent 352ef85 commit 44c5266

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ module.exports = function getGeneratorFunctions() {
1111
try {
1212
generatorFuncs.push(Function('return { * concise( ){ var x = yield; return x || 42; } }.concise;')());
1313
} catch (e) {}
14+
try {
15+
generatorFuncs.push(Function('function * handle (next) {\n yield next\n}\nreturn handle;')());
16+
} catch (e) {}
1417

1518
return generatorFuncs;
1619
};

0 commit comments

Comments
 (0)