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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Invalid yield* in Symbol.iterator #15172

Closed
1 task
p51lee opened this issue Nov 9, 2022 · 1 comment 路 Fixed by #15841
Closed
1 task

[Bug]: Invalid yield* in Symbol.iterator #15172

p51lee opened this issue Nov 9, 2022 · 1 comment 路 Fixed by #15841
Labels
i: enhancement outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@p51lee
Copy link

p51lee commented Nov 9, 2022

馃捇

  • Would you like to work on a fix?

How are you using Babel?

Other (Next.js, Gatsby, vue-cli, ...)

Input code

var [ x ] = { [ Symbol . iterator ] : function * ( ) { yield * 0 ; } } ;

Configuration file name

No response

Configuration

No response

Current and expected behavior

input.js throws TypeError:

$ node input.js
input.js:1
var [ x ] = { [ Symbol . iterator ] : function * ( ) { yield * 0 ; } } ;
                                                       ^

TypeError: number 0 is not iterable (cannot read property Symbol(Symbol.iterator))
    at [Symbol.iterator] (input.js:1:56)
    at Generator.next (<anonymous>)
    at Object.<anonymous> (input.js:1:7)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)

but output.js is terminated normally:

$ node output.js # no error

Environment

Reproduction on Babel's own REPL

Possible solution

No response

Additional context

No response

@babel-bot
Copy link
Collaborator

Hey @p51lee! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Nov 5, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: enhancement outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants