microsoft / microsoft/TypeScript

Valid JS code reported by TS as illegal code: Keywords cannot contain escape characters

Open
#54,196 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Domain: Parser Help Wanted
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
1d 19h
Merged PRs (30d)
117

Description

Bug Report

🔎 Search Terms

\u{63}onstructor()
valid javascript code returns error
Keywords cannot contain escape characters
escape characters

🕗 Version & Regression Information
  • This is the behavior in every version I tried.
⏯ Playground Link

Playground link with relevant code

💻 Code
class C {
  \u{63}onstructor() {}  // equivalent to: constructor() {}
}
🙁 Actual behavior

Errors in code
Keywords cannot contain escape characters.

🙂 Expected behavior

No errors as it is valid javascript code.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked TypeScript Playground and the class example using \u{63}onstructor(), then compare it with the equivalent constructor() form. Investigate the compiler path that reports "Keywords cannot contain escape characters"; done means valid JavaScript produces no error while preserving the expected behavior for invalid escapes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.