Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Wrong renaming output due to wrong scope analysis #419

@hyf0

Description

@hyf0

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:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions