-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[CS2] Don’t require async/await support to run coffee
#4679
[CS2] Don’t require async/await support to run coffee
#4679
Conversation
…t’ wrapper in the REPL to use a Promise instead of the ‘await’ keyword; add tests for REPL ‘await’ wrapper, including test to skip async tests if the runtime doesn’t support them
Cakefile
Outdated
try | ||
new Function('async () => {}')() | ||
yes | ||
catch exception |
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.
exception
isn't used here so you could just as well remove it.
@@ -409,6 +409,17 @@ runTests = (CoffeeScript) -> | |||
description: description if description? | |||
source: fn.toString() if fn.toString? | |||
|
|||
global.supportsAsync = if global.testingBrowser |
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.
Do we really need this if
? Could we not just always feature test it?
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.
Unfortunately not. See the comment at the top of test/async.coffee
. Even with a feature test at the top of that file, and a return
if it fails, a runtime that doesn't support async will throw an error just from trying to parse the file. Also there's an async test in repl.coffee
now, so I want to feature test this once and cache the result rather than having it in two places.
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.
One request for clarification, but otherwise LGTM 👍
Also, if we want to support node 6 should we update |
I thought about updating the |
Yeh... this is a bit of a murky area. I'm not sure how many people really pay attention to the I feel like |
I just fear another #4610. But I guess if the tests pass, and Maybe it’s time to set up Travis CI to run builds/tests in Node 6 and 8 on every push. |
Aside from #4604, the
coffee
command runs in Node 6 (though the tests don’t). See #4676. I feel like we might as well support Node 6 if we can, and it seems that all we need to do so is convert oneawait
into aPromise
.I also added a test for the functionality added in #4604, plus a guard so that the tests (other than the async ones) can also run in Node 6.
I noticed that
cake test
is returning before the async tests have completed; see #4680.