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

panic: Object rest pattern should be removed by es2018::object_rest_spread pass #2531

Closed
Bosseskompis opened this issue Oct 25, 2021 · 1 comment · Fixed by #2538
Closed
Labels
Milestone

Comments

@Bosseskompis
Copy link

Bosseskompis commented Oct 25, 2021

This error started happening in version 1.2.99 and onwards.

  1. Source code
const items = []
for (const item of items) {
    const { name, ...rest } = item
}
  1. .swcrc file
{
    "jsc": {
        "parser": {
            "syntax": "ecmascript",
            "jsx": true
        },
        "transform": {
            "react": {
                "runtime": "automatic",
                "development": true,
                "refresh": true
            }
        }
    }
}
  1. Error message gained from swc --sync <input.js>
    entered unreachable code: Object rest pattern should be removed by es2018::object_rest_spread pass', ecmascript\transforms\compat\src\es2015\destructuring.rs:410:52
@kdy1 kdy1 added this to the v1.2.104 milestone Oct 26, 2021
kdy1 added a commit to kdy1/swc that referenced this issue Oct 26, 2021
kdy1 added a commit to kdy1/swc that referenced this issue Oct 26, 2021
kdy1 added a commit that referenced this issue Oct 26, 2021
swc_ecma_transforms_base:
 - `unique_scopes`: Handle method properties.
 - `hygiene`: Fix handling of method properties. (#2539)

swc_ecma_transforms_compat:
  - Fold children of for-of/in statements. (#2531)

swc_ecma_minifier:
 - `name_mangler`: Fix handling of method properties.
@swc-bot
Copy link
Collaborator

swc-bot commented Oct 21, 2022

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 Oct 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

3 participants