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

feat: add side effect detection for most of the statements #555

Merged
merged 11 commits into from
Mar 11, 2024

Conversation

Demivan
Copy link
Contributor

@Demivan Demivan commented Mar 11, 2024

Description

Implemented side effect detection for:

  • BlockStatement
  • DoWhileStatement
  • WhileStatement
  • IfStatement
  • ReturnStatement
  • LabeledStatement
  • TryStatement
  • EmptyStatement
  • ContinueStatement
  • BreakStatement
  • SwitchStatement

Test Plan

Rust tests added.

Actually disabled one failing Rollup test:

if ( false ) {
	var foo;
}

assert.equal( foo, undefined );

After implementing side effect detection for if test is now failing. This is because VariableDeclaration without init is considered side effect free right now.
VariableDeclaration needs a better detection. It is not side effect free if it is being referenced.

Copy link

netlify bot commented Mar 11, 2024

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit dd99e11
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/65ef389db9d30a0008d96c4a

Copy link

netlify bot commented Mar 11, 2024

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 47eb19a
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/65ef3b842c94cc0008a4b39e

@Demivan Demivan marked this pull request as draft March 11, 2024 17:01
@Demivan Demivan marked this pull request as ready for review March 11, 2024 17:18
Copy link
Member

@hyf0 hyf0 left a comment

Choose a reason for hiding this comment

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

Thank you!

@hyf0 hyf0 merged commit ec43f04 into rolldown:main Mar 11, 2024
11 of 12 checks passed
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.

None yet

2 participants