Skip to content

Update to acorn 2.7.0. Invoke async function in es7 mode 'eagerly'

Choose a tag to compare

@matAtWork matAtWork released this 04 Feb 15:16
· 198 commits to master since this release
  • Update to Acorn v2.7.0. This tightens up the parsing of some ES6 edge cases and could possibly break old ES5 sloppy mode code
  • Implement 'eager' evaluation for 'ES7' mode (promises & generators always were eager). This means that you can invoke an async function without a preceding await (simply by calling it as normal), but you can't get the result. This is useful for initiating 'background' things, or running async functions for their side effects. This brings the semantics of all modes into compliance with the specification, but changes those of 'ES7' mode compared to versions prior to 2.3.x. Specifically calls to myAsyncFunction() without an await in v2.3.13 or earlier wouldn't actually execute the function body, but would provide a Thenable that would. As of v2.4.0, the body is executed in any case, but without the await the result is not available. v2.4.0 will behave as earlier versions if you specify the code-generation option lazyThenables.