-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow compiling async functions to generators #2102
Conversation
@johnjbarton The feature tests now run all |
createIdentifierExpression(ARGUMENTS) : | ||
createNullLiteral(); | ||
const statement = parseStatement | ||
`return $traceurRuntime.spawn(this, ${argExpr}, function*() { ${body} });` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised to see es6-ish here. Is there no combination of options where this generator function parse will fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. This is only enabled if parsing generators is enabled.
Regarding the two-pass tests, duplicating the files with different options is not a horrible alternative and probably makes the system simpler. But it's ok this way. LGTM |
There is also one more complication and that is that we need to detect if there is native support for generators. For example Node 0.10 does not have generators. I thought of doing some optional skip directive fur the test runner... |
This is done by setting `--async-functions --generators=parse`. Related to google#1231 Fixes google#1780
I ended up duplicating the test and adding support for conditional skip to the feature test runner. I also changed the options slightly, so that if |
This is done by setting
--async-functions=generator --generators=parse
.Related to #1231
Fixes #1780