Javascript lexer misclassifies `async`

Issue #1446 new
David Brownman
created an issue

Hi there!

When using the JS lexer, the "await" keyword is listed as "Token.Name.Other" rather than "Token.Keyword.Reserved". This extends to other related tokens, such as "async"

My test input was:

const j = async () => await Promise.resolve(3)

Comments (2)

  1. jonluca

    There is also an ancillary issue to JavaSript's async keyword - it's incorrectly colored when it is the name of a variable in a function definition, as below:

    function testFunc(param1, param2, async){
        // do something
    }
    

    An example can be found here, near the bottom of the page, at XMLHttpRequest.prototype.open = function (method, url, async, user, pass).

  2. Log in to comment