-
Notifications
You must be signed in to change notification settings - Fork 710
Labels
Description
Reproduction link or steps
What is expected?
The intermediate variable should not be removed since assigning dfd.promise relies on the fact that the promise initialization was run first. rollup does not erase the variable.
rollup repl:
swc repl:
What is actually happening?
rolldown erases the intermediate variable causing a runtime exception (cannot assign to null)
System Info
System:
OS: macOS 15.7.1
CPU: (12) arm64 Apple M2 Pro
Memory: 1.67 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.11.0 - /Users/jess7953/.nvm/versions/node/v24.11.0/bin/node
npm: 11.6.1 - /Users/jess7953/.nvm/versions/node/v24.11.0/bin/npm
npmPackages:
rolldown: ^1.0.0-beta.50 => 1.0.0-beta.50Any additional comments?
I know this is a contrived example and it's a bit dubious, but I think optimization should not change runtime behavior.
Reactions are currently unavailable