question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can no longer call a function named `async`

See original GitHub issue

Looks like the fix to https://github.com/google/closure-compiler/issues/2244 resulted in a regression in that it disallows calling a function called async.

Example:

var x = {async: function(){return 3;}}
x.async()

This now results in the following error:

Parse error. No newline allowed before '=>'

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:9
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

22reactions
anmonteirocommented, Feb 27, 2017

The ClojureScript compiler is heavy reliant on the Google Closure Compiler. We’re really excited about what the recent developments in processing CommonJS and ES6 modules represent for our community. However, introducing this change relating to the async keyword simply breaks every ClojureScript project out there using the immensely popular core.async library. My opinion is that, by not reserving the keyword for that usage, we could achieve backwards compatibility.

This has come up after we upgraded to the February release and is now a blocker to future upgrades.

At the end of the day, this is obviously your project and you choose how to run it. I just wanted to give my perspective on what the consequences are for ClojureScript.

17reactions
brad4dcommented, Feb 28, 2017

Sounds like this is much more of a problem than yield was. I’m working on fixing it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does an async function always need to be called with await?
Async functions are not necessarily required to have an await call inside it, but the reason behind making a function async is that...
Read more >
async function - JavaScript - MDN Web Docs - Mozilla
An async function will return a different reference, whereas Promise.resolve returns the same reference if the given value is a promise. It can...
Read more >
Call async from non-async - The Modern JavaScript Tutorial
Just treat async call as promise and attach . then to it: async function wait() { await new Promise(resolve => setTimeout(resolve, 1000)); return...
Read more >
Because this call is not awaited, execution of the current ...
The current method calls an async method that returns a Task or a Task<TResult> and doesn't apply the Await operator to the result....
Read more >
Is there a way to define a function that can be used as a nomal ...
Well, is a solution, but you have to put all your async code in a folder apart. Can't we apply duck typing to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found