Skip to content

Commit 341a116

Browse files
crisbetothePunderWoman
authored andcommitted
fix(compiler): allow more characters in let declaration name (#56764)
Fixes that `@let` didn't allow $ in its name, even though JS identifiers allow it. PR Close #56764
1 parent 551027e commit 341a116

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

packages/compiler/src/ml_parser/lexer.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,13 @@ class _Tokenizer {
407407
let allowDigit = false;
408408

409409
this._attemptCharCodeUntilFn((code) => {
410-
// `@let` names can't start with a digit, but digits are valid anywhere else in the name.
411-
if (chars.isAsciiLetter(code) || code === chars.$_ || (allowDigit && chars.isDigit(code))) {
410+
if (
411+
chars.isAsciiLetter(code) ||
412+
code == chars.$$ ||
413+
code === chars.$_ ||
414+
// `@let` names can't start with a digit, but digits are valid anywhere else in the name.
415+
(allowDigit && chars.isDigit(code))
416+
) {
412417
allowDigit = true;
413418
return false;
414419
}

0 commit comments

Comments
 (0)