Skip to content

(javascript) regression: “for await“ highlighted as function instead of keyword #4235

Closed
@wolfgang42

Description

@wolfgang42

Describe the issue
In the statement for await (foo) {}, the keyword await is being incorrectly highlighted as a function since 063876f (#3940).

Which language seems to have the issue?
JavaScript

Are you using highlight or highlightAuto?
highlight

Sample Code to Reproduce

for await (foo) {}

Expected behavior
for await are both highlighted as keywords.

Additional context

I upgraded highlight.js and this stopped working. I bisected the problem to 063876f (#3940), but I don’t really understand the internals of highlight.js well enough to figure out why that code is being triggered in this position or what to do about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions