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/parser): Fix detection of use strict directive #8617

Merged
merged 8 commits into from
Feb 7, 2024

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Feb 7, 2024

Description:

Directives should be at the start of the file, and this PR changes the parser to match only at the start of a file.

Related issue:

@kdy1 kdy1 added this to the Planned milestone Feb 7, 2024
@kdy1 kdy1 self-assigned this Feb 7, 2024
@kdy1 kdy1 requested a review from a team as a code owner February 7, 2024 07:16
Copy link

changeset-bot bot commented Feb 7, 2024

⚠️ No Changeset found

Latest commit: 4fbecd3

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

kodiakhq[bot]
kodiakhq bot previously approved these changes Feb 7, 2024
Copy link
Member Author

@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_ast
  • swc_ecma_parser

kodiakhq[bot]
kodiakhq bot previously approved these changes Feb 7, 2024
return (
function (moduleArg = {}) {
var Module = moduleArg;
var readyPromiseResolve, readyPromiseReject; Module["ready"] = new Promise((resolve, reject) => { readyPromiseResolve = resolve; readyPromiseReject = reject }); "use strict";
Copy link

Choose a reason for hiding this comment

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

Should add one more statement "use strict" for this test cases? The origin issue mentioned that there were two "use strict" in the same function.

Copy link
Member Author

Choose a reason for hiding this comment

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

It does not matter, because it's not at the start anyway

@kdy1 kdy1 enabled auto-merge (squash) February 7, 2024 14:33
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 95236e9 into swc-project:main Feb 7, 2024
@kdy1 kdy1 deleted the issue-8616 branch February 7, 2024 15:01
@kdy1 kdy1 modified the milestones: Planned, v1.4.1 Feb 13, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
4 participants