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

Incorrect inlining results in invalid left hand assignment #7640

Closed
petyosi opened this issue Jul 7, 2023 · 3 comments
Closed

Incorrect inlining results in invalid left hand assignment #7640

petyosi opened this issue Jul 7, 2023 · 3 comments
Assignees
Labels
Milestone

Comments

@petyosi
Copy link

petyosi commented Jul 7, 2023

Describe the bug

The minification of the @lezer/markdown package results in an invalid left hand assignment code. I've stripped the code up to my best.

Input code

const scanLineResult = { text: "", end: 0 };
/// Block-level parsing functions get access to this context object.
export class BlockContext {
    /// @internal
    scanLine(start) {
        let r = scanLineResult;
        r.end = start;
        if (start >= this.to) {
            r.text = "";
        }
        else {
            
        }
        return r;
    }
    
}

Config

No response

Playground link

https://play.swc.rs/?version=1.3.66&code=H4sIAAAAAAAAA22QwW4CMQxE7%2FmKEScqtbucQVtV9NoTfxBSQ9NGCbK9CAntv%2BPsUmir%2BhSNZ55HcaFkUUjw%2BS1m2pD0SdHhDKWTLjGbPYLy%2BxILDCvXti3WqYSvp0RHSjh4lpj32PU5aDQS9qTwIZAItEA%2FosAuVBbK9pOCNo5Oh8KKkLyZRtrr1XF2sKlHXqIpnH0ale92c1HP%2BnD11Ul2jq3u7%2F6r254bK1%2F3NXiX4w4TC8%2FdWLLR8hM7RcdOnX3BPTjcXpSE%2FiT%2BcTFpzxk8ESbdDe4CfUM7BnYBAAA%3D&config=H4sIAAAAAAAAA32UyY7bMAxA7%2FMVgYHeBkVRYC499NjfEBSJcjSVREOkMjEG%2BffSS5NgQvtm83ER18%2BXw6F7J9f9OnzKp%2FwMthLU279IaCxsLyLpwGVLrsaBuxleXxcbtrUHnjXorVuFOZYYxkdHDvNQgehBJlKxbRkKT%2BJgE8HrI6v4MQGu7VF%2BRExgyw4xlkwsDD1UzbHDlOxAYM62Kl6ml9oaCbUQE2wM3gwVB5UXHzlikZjP1IP1xqEHBcUKjuMZNDOJJWaFJD0lnxl7OLa%2Bn5v3xRrONjXLSky4zC2R1ypeTxiJTWhFK%2BECN2qwwLW4Xy1jMBW41fJs946xbPTkL4BUIFmiYjNofmeNIPO0ZR12LWMJMrI8KjyhmmWBXopqYgxKZafKQOWodbOCbw6myjrtOSveKB9FDwZCkFlRXNNHZHfSgvI4AAYFSH9t0KZqAea2hRt8Wogd%2FEeyZH3AVo1s%2BbRNacxHTDsBMvAJ%2FY6CtIJxG1e5Epdhm7fiQUYDvKrSaAbPR0AWgNGk%2BTA%2BzYash3g0fcLj%2FUysCtf%2Fml22pb%2Fv%2B3JzX1aFDsr5fraXEzw56n4ffnz%2F%2BfatuyneLvHi5foPejTc0PUFAAA%3D

Expected behavior

A valid code should be generated.

Actual behavior

swc generates this:

                return 0 = start, // ... 

Version

1.3.66

Additional context

No response

@DIYgod
Copy link

DIYgod commented Jul 8, 2023

I am using @codemirror/lang-markdown, and I am encountering the same problem.

@Austaras
Copy link
Member

Already fixed by #7534

@kdy1 kdy1 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2023
@kdy1 kdy1 reopened this Jul 12, 2023
@kdy1 kdy1 closed this as completed Jul 12, 2023
@kdy1 kdy1 modified the milestones: Planned, v1.3.69 Jul 13, 2023
@swc-bot
Copy link
Collaborator

swc-bot commented Aug 12, 2023

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Aug 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

5 participants