Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escaped expressions containing a real expression in a template literal inside a a lambda inside a class method break the parser #592

Closed
ArneBab opened this issue Oct 4, 2022 · 2 comments

Comments

@ArneBab
Copy link
Contributor

ArneBab commented Oct 4, 2022

When using a template literals to create a string that contains an expression (${something}) the parser reports an error:

class Bar {
  foo () {
    [1, 2, 3].forEach((a) => {
      const valid = `\${${a}}`;
      const variable = '123'; // this is highlighted in red as broken
      // in valid, the second '{' and 'a' and the second '}' and the second '`' are also highlighted in red as broken
    });
  }
}

I put the second comment after valid, because when adding that comment on the line of valid, the error does not spill into the line with variable anymore.

@ArneBab ArneBab changed the title Escaped expressions containing a real expression in a template literal break the parser Escaped expressions containing a real expression in a template literal inside a a lambda inside a class method break the parser Oct 4, 2022
@dgutov dgutov closed this as completed in 7480c79 Oct 9, 2022
@dgutov
Copy link
Collaborator

dgutov commented Oct 9, 2022

Thanks for the report, should be fine now.

@ArneBab
Copy link
Contributor Author

ArneBab commented Oct 10, 2022

Awesome — thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants