(n: string)
| 110 | const isCore = isCoreLike(path.node.source?.value as string); |
| 111 | // Ensure any generated binding names are valid identifiers and not reserved like 'this' |
| 112 | const isValidLocal = (n: string) => { |
| 113 | try { |
| 114 | return t.isValidIdentifier(n) && n !== 'this'; |
| 115 | } catch { |
| 116 | return /^[A-Za-z_$][\w$]*$/.test(n) && n !== 'this'; |
| 117 | } |
| 118 | }; |
| 119 | const makeUniqueLocal = (base: string) => { |
| 120 | let name = base; |
| 121 | if (!isValidLocal(name)) { |