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

fix: A Symbol should only be declared in one chunk #338

Merged
merged 2 commits into from
Nov 20, 2023

Conversation

hyf0
Copy link
Member

@hyf0 hyf0 commented Nov 20, 2023

Description

Test Plan


@hyf0
Copy link
Member Author

hyf0 commented Nov 20, 2023

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

@hyf0 hyf0 changed the title fix: A Symbol should not be declared twice fix: A Symbol should only be declared in one chunk Nov 20, 2023
@@ -116,11 +116,13 @@ impl<'a> BundleStage<'a> {
Module::Normal(module) => {
for stmt_info in module.stmt_infos.iter() {
for declared in &stmt_info.declared_symbols {
// TODO: pass debug_assert!(self.graph.symbols.get(*declared).chunk_id.is_none());
// FIXME: I don't think this is correct, even though the assigned chunk_id is the same as the current chunk_id.
// A declared symbol should only be processed once.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A declared symbol is expected to see more than once.

var outsideVar = 'outside';
let outsideLet = 'outside';

try {
	throw new Error();
} catch (e) {
	var outsideVar = 'inside';
	let outsideLet = 'inside';
	var insideVar = 'inside';
}

assert.equal(outsideVar, 'inside');
assert.equal(outsideLet, 'outside');
assert.equal(insideVar, 'inside');

@hyf0
Copy link
Member Author

hyf0 commented Nov 20, 2023

Merge activity

  • Nov 20, 2:17 AM: @hyf0 started a stack merge that includes this pull request via Graphite.
  • Nov 20, 2:17 AM: Graphite rebased this pull request as part of a merge.
  • Nov 20, 2:18 AM: @hyf0 merged this pull request with Graphite.

Base automatically changed from 11-20-fix_allow_cjs_to_be_both_entry_and_dependency to main November 20, 2023 07:17
@hyf0 hyf0 force-pushed the 11-20-fix_A_Symbol_should_not_be_declared_twice branch from d0a7f37 to 1c2fc5a Compare November 20, 2023 07:17
@hyf0 hyf0 merged commit 340cd27 into main Nov 20, 2023
6 checks passed
@hyf0 hyf0 deleted the 11-20-fix_A_Symbol_should_not_be_declared_twice branch November 20, 2023 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants