-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat(espower): disambiguate between function calls and async/yield expressions #23
feat(espower): disambiguate between function calls and async/yield expressions #23
Conversation
…pressions In order to fully disambiguate the contextual keywords `async` and `yield`, we need to pass along some addtional context to power-assert-formatter. Specifically whether the enclosing function is async or a generator. This adds two new properties to the context passed to `assert._expr()` - `async: true` if the function enclosing the assertion is an async function - `generator: true` if the function enclosing the assertion is a generator In both cases, we do not set a property if the enclosing function is not a generator/async (i.e. we never pass `async:false`). This is primarily to avoid having to rewrite a bunch of existing unit tests.
@jamestalmage Looks good to me now. |
I'm starting to see the convenience of this: https://github.com/babel/babel/blob/master/doc/design/monorepo.md |
Yeah now I know the Pros (and Cons) of monorepo approach. |
@twada this is ready. |
9fdcb7d
to
398585f
Compare
@jamestalmage I appreciate your kind offer. |
@twada Already done! |
@jamestalmage Oh you are responding so quickly! |
feat(espower): disambiguate between function calls and async/yield expressions
This is probably a minor bump instead of a patch. |
Not a bugfix but a feature? |
Adds support for monitoring the `asyn` and `generator` flags set by espower. See power-assert-js/espower#23
Sure - it is a bugfix I guess. |
1.2.1 is fine. |
Okay It'll be |
Adds support for monitoring the `asyn` and `generator` flags set by espower. See power-assert-js/espower#23
In order to fully disambiguate the contextual keywords
async
and
yield
, we need to pass along some additional context topower-assert-formatter. Specifically whether the enclosing function
is async or a generator.
This adds two new properties to the context passed to
assert._expr()
async: true
if the function enclosing the assertion is an async functiongenerator: true
if the function enclosing the assertion is a generatorIn both cases, we do not set a property if the enclosing function is not
a generator/async (i.e. we never pass
async:false
). This is primarilyto avoid having to rewrite a bunch of existing unit tests.