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

TS generator: object ref is not transformed correctly #5859

Closed
magic-akari opened this issue Sep 14, 2022 · 1 comment · Fixed by #5861
Closed

TS generator: object ref is not transformed correctly #5859

magic-akari opened this issue Sep 14, 2022 · 1 comment · Fixed by #5861
Labels
Milestone

Comments

@magic-akari
Copy link
Member

Describe the bug

issue from vercel/next.js/issues/40535

Input code

const result = [];

const logic = async () => {
    const inputs = ["one", "two", "three"]

    for (const input of inputs) {
        result.push({ input });
    }
};

logic().then(() => {
    console.log(result);
})

Config

{
  "jsc": {
    "parser": {
      "syntax": "ecmascript",
      "jsx": false
    },
    "target": "es5"
  },
  "module": {
    "type": "es6"
  },
  "isModule": true
}

Playground link

https://play.swc.rs/?version=1.3.0&code=H4sIAAAAAAAAA11OSQrDMAy86xXCJxlKPhDSj5QcilHqgLGCF0oJ%2Fnsd24fSuQhm0xjxMWHgmF3CBR%2FrDGAa5%2BS1m0o948cbJI3LHU%2FAiq7v%2FsgpXhklntUNVXpLOzYwqxWad5OA9BNA2UZSj7YL%2Ff905GjpHMai56YXKHVTW0N6SpY9%2FY8Rx1M1UK%2BpuaLhCw7v1b7ZAAAA&config=H4sIAAAAAAAAAy2LQQ6AIAwE%2F9IzVz3wBx%2FRYDUYUNKWRGL4u9R4252dfeCQAP6BgizElqSdijd4oJBRAsei4IY20IZJqDtQ5J3UFJlg9HytNZGdtRX6%2BGw8yvIvypX6C9UPjkhtAAAA

Expected behavior

log "one", "two", "three"

Actual behavior

log "three", "three", "three"

Version

1.3.0

Additional context

No response

@kdy1 kdy1 added this to the Planned milestone Sep 14, 2022
@kdy1 kdy1 modified the milestones: Planned, v1.3.2 Sep 19, 2022
@swc-bot
Copy link
Collaborator

swc-bot commented Oct 19, 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 19, 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