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(es/resolver): Correctly check strict mode #8851

Merged
merged 2 commits into from
Apr 13, 2024
Merged

Conversation

Austaras
Copy link
Member

Description:

BREAKING CHANGE:

Related issue (if exists):
Closes #8842

@Austaras Austaras requested a review from a team as a code owner April 12, 2024 08:34
Copy link

changeset-bot bot commented Apr 12, 2024

⚠️ No Changeset found

Latest commit: 1f86a6d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -47,15 +47,15 @@ where
let lexer = Lexer::new(syntax, EsVersion::latest(), StringInput::from(&*fm), None);
let mut parser = Parser::new_from(lexer);

let module = parser
.parse_module()
let program = parser
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated test file changes come from this.

@kdy1 kdy1 added this to the Planned milestone Apr 12, 2024
kdy1
kdy1 previously approved these changes Apr 12, 2024
Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

swc-bump:

  • swc_ecma_transforms_base
  • swc_core

@kdy1 kdy1 enabled auto-merge (squash) April 12, 2024 10:32
@kdy1 kdy1 changed the title fix(es/base): Correctly check strict mode fix(es/resolver): Correctly check strict mode Apr 12, 2024
Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

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

Automated review comment generated by auto-rebase script

@kdy1 kdy1 disabled auto-merge April 12, 2024 11:00
@kdy1
Copy link
Member

kdy1 commented Apr 12, 2024

CI failed and it does not look like a random failure.

Diff < left / right > :
 "use strict";
 function f() {
<    var x, g1;
>    var x, g;
     g();
     x = 10;
     throw Error("foo");
 }
 f();
 

@Austaras
Copy link
Member Author

Consider the terser output, I believe the new output is desired.

"use strict";
function f() {
    g();
    x = 10;
    throw new Error("foo");
    var x;
}
f();

Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

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

Automated review comment generated by auto-rebase script

@kdy1 kdy1 merged commit f6ba92b into swc-project:main Apr 13, 2024
149 of 290 checks passed
@kdy1 kdy1 modified the milestones: Planned, 1.4.14 Apr 15, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

minifier: invalid handling of function scope
3 participants