Commit 320dbae
Fix export name leak from nested function bodies
`export const a = t => { const o = ...; }` registered the arrow-local
`o` as an exported name: the nameDeclaredCallback installed while
parsing an exported declaration stayed active while nested function
bodies were parsed. A second exported arrow declaring `o` then failed
the whole module with "duplicate export name 'o'" -- make-plural's
cardinals module (which openstreetmap.org loads for localization) is
exactly this shape.
A single occurrence did not collide, so the module parsed but still
leaked the body-local into the namespace (Object.keys gained the extra
name); the duplicate-name parse error was just the loud case.
Both nested-body parse paths saved the callback but never cleared it
(the expression-body arrow path didn't even restore its dead saved
copy); null it during the nested parse and restore afterwards.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Joonhyung Hwang <jh1984.hwang@samsung.com>1 parent 1130c0f commit 320dbae
2 files changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3407 | 3407 | | |
3408 | 3408 | | |
3409 | 3409 | | |
| 3410 | + | |
| 3411 | + | |
| 3412 | + | |
| 3413 | + | |
3410 | 3414 | | |
| 3415 | + | |
3411 | 3416 | | |
3412 | 3417 | | |
3413 | 3418 | | |
3414 | 3419 | | |
3415 | 3420 | | |
| 3421 | + | |
3416 | 3422 | | |
3417 | 3423 | | |
3418 | 3424 | | |
| |||
5224 | 5230 | | |
5225 | 5231 | | |
5226 | 5232 | | |
| 5233 | + | |
| 5234 | + | |
| 5235 | + | |
| 5236 | + | |
| 5237 | + | |
5227 | 5238 | | |
5228 | 5239 | | |
5229 | 5240 | | |
| |||
0 commit comments