You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found some cases where the async keyword is not highlighted properly, attaching code snippet - please see the comments inline.
functiongetObject(){return{// No async highlight for function shorthandsasyncdoStuff(){},// No async highlight for function declarationsdoOtherStuff: asyncdoOtherStuff(){},// async is highlighted properly for function expressionsdoDifferent: asyncfunction(){}// async is highlighted properly for arrow function expressions
doElse: async()=>{}}}
Changing return to an assignment (const obj = { ...) fixes the highlight for the async keyword.
I am attaching a screenshot from my editor for brevity, since github shows the highlights properly for the snippet above, which might be confusing. 😄
Here is a screenshot of what happens when I change the return to an assignment:
The text was updated successfully, but these errors were encountered:
robertrossmann
changed the title
Missing highlight on async function when returning objects
Missing highlight on async functions when returning objects
Apr 29, 2016
I have found some cases where the
async
keyword is not highlighted properly, attaching code snippet - please see the comments inline.Changing
return
to an assignment (const obj = { ...
) fixes the highlight for theasync
keyword.I am attaching a screenshot from my editor for brevity, since github shows the highlights properly for the snippet above, which might be confusing. 😄
Here is a screenshot of what happens when I change the return to an assignment:
The text was updated successfully, but these errors were encountered: