The set function reassigns itself internally.
When eval exists within the scope, the set function's name should be protected, but it's incorrectly renamed to set1, causing the helpers to fail to execute properly.
It was introduced by #9546
Input code
class A {
world = false
}
eval("hello")
class B extends A {
constructor() {
super()
}
set hello(v) {
super.world = v
}
get hello() {
return super.world
}
}
Config
No response
Playground link (or link to the minimal reproduction)
Describe the bug
The set function reassigns itself internally. When
eval
exists within the scope, the set function's name should be protected, but it's incorrectly renamed toset1
, causing the helpers to fail to execute properly.It was introduced by #9546
Input code
Config
No response
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.7.37-nightly-20241021.1&code=H4sIAAAAAAAAA03NPQ6DMAwF4Dk%2BhcUUlt6Aob1JFFwYrKSynYBUcffyUxCbZX%2FvOXJQxSd%2BwU1ZuMcO34GVYAGgGtg3IzHnpgWIO30hzUap%2F4diTmpSomXx7bZwWj60zuDWBqdkuBf4ers%2Bzlf1UMOlDiRkRRLe7OaWH0dO9hOsAAAA&config=H4sIAAAAAAAAA12PSw6DMAxE95wCed1tNz1BNz2ElRoU5HxkBwmEuHsDJLRll3ljjydL07YwqIFHu%2BRnFhFFSU6dic4%2B4ZQJkHGoRmxMcKvuoJvVISvtaD0cSIJeuyAuu35krhilp7SH6b2kAIegVFMKoymReOQncSTRi%2Bust93829Kh7%2FkSkrEJLgqp%2FndsSk9w4T3uW%2BX3aY6b2tZc8IPCOWn1VWfPC98aR%2Fb6AXANGa1PAQAA
SWC Info output
No response
Expected behavior
keep name
set
Actual behavior
set
is renamed toset1
while usages are stillset
Version
1.7.36
Additional context
No response