mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
c96a69fff8
Writing mappings for JSX identifiers requires different logic than for normal `Identifiers`. - Add specialized function `writeWithMapNamedJSXNoLast` for writing `JSXIdentifier`s. - Move the logic for getting original name of a `JSXIdentifier` into a separate function. - Branch on an `isJSXIdentifier` param passed in to `markMapNamed`, to decide which function to use to get original identifier name. The main motivation is to avoid having to pass `node` into `originalNameFromSource`, where reading `node.type` is a polymorphic access (because `node` could be an `Identifier`, an `PrivateIdentifier` or `JSXIdentifier`). This is part of a broader move to remove the reliance of all `write` and `markMap` functions on receiving polymorphic/megamorphic `node` params (later PRs in this stack).