Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong renaming output due to wrong scope analysis #419

Closed
hyf0 opened this issue Jan 29, 2024 · 0 comments
Closed

Wrong renaming output due to wrong scope analysis #419

hyf0 opened this issue Jan 29, 2024 · 0 comments

Comments

@hyf0
Copy link
Member

hyf0 commented Jan 29, 2024

This is because the symbol b has two owner scopes, which makes rolldown consider it conflicted. So the symbol b was wrongly appiled the renaming logic and became b$1.

For input

// entry.js
(() => {
	function a() {
		b();
	}
	{
		var b = () => {
		};
	}
	a();
})();

The correct output should be

// entry.js
(() => {
	function a() {
		b();
	}
	{
		var b = () => {
		};
	}
	a();
})();

instead of https://github.com/rolldown-rs/rolldown/blob/b3c5e0178aec3381b54ed9bde3ee94bfa0fc0cc2/crates/rolldown/tests/esbuild/default/nested_scope_bug/artifacts.snap.


Related issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant