fix: add missing $ and _ characters to identifier tables

The previous fix for middle dot characters accidentally broke $ and _
character parsing in JavaScript identifiers. These characters are
special cases in ECMAScript that must be explicitly added to the
ID_Start and ID_Continue sets, as they are not included in the
standard Unicode categories.

This restores support for:
- $ in destructuring: import { $ } from "bun"
- _ in variable names: const _private = 123
- All other $ and _ usage in identifiers

While maintaining the fix for Japanese middle dot characters.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude Bot
2025-08-29 06:49:58 +00:00
parent 98311300a3
commit 4497265e34
2 changed files with 4 additions and 4 deletions

View File

@@ -83,12 +83,12 @@ async function main() {
{
name: "isIDStartESNext",
table: "idStartESNext",
check: (cp: number) => idStartESNextSet.has(cp),
check: (cp: number) => idStartESNextSet.has(cp) || cp === 0x24 || cp === 0x5F, // Add $ and _
},
{
name: "isIDContinueESNext",
table: "idContinueESNext",
check: (cp: number) => idContinueESNextSet.has(cp) && !ID_Continue_mistake.has(cp),
check: (cp: number) => (idContinueESNextSet.has(cp) && !ID_Continue_mistake.has(cp)) || cp === 0x24 || cp === 0x5F, // Add $ and _
},
];

File diff suppressed because one or more lines are too long