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

"yield* undefined" should throw, but doesn't #1648

Closed
AmitAber opened this issue May 29, 2015 · 4 comments · Fixed by #15841
Closed

"yield* undefined" should throw, but doesn't #1648

AmitAber opened this issue May 29, 2015 · 4 comments · Fixed by #15841
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Spec Compliance 👓 A type of pull request used for our changelog categories
Milestone

Comments

@AmitAber
Copy link

according to the spec, and as implemented in other engines (traceur, v8...), yield* undefined should throw a TypeError exception. Instead, the line is ignored / exception is caught and hidden inside.

To reproduce:

function* gen() {
  yield* undefined;
}

let y = gen();
while(true) {
  let r = y.next();
  for(let key in r)
    console.log(`  ${key}: ${r[key]}`);
  if(r.done)
    break;
}
@sebmck
Copy link
Contributor

sebmck commented May 29, 2015

Please report this on the regenerator repo.

@AmitAber
Copy link
Author

I reported the bug as you suggested. (regenerator issue link)

@eventualbuddha
Copy link
Member

@AmitAber at least cross-link them by posting a link to the issue you filed here. Thanks!

@sebmck sebmck added bug PR: Spec Compliance 👓 A type of pull request used for our changelog categories labels May 31, 2015
@sebmck sebmck modified the milestone: 6.0.0 Sep 30, 2015
@sebmck
Copy link
Contributor

sebmck commented Oct 11, 2015

Closing in favor of facebook/regenerator#202.

@sebmck sebmck closed this as completed Oct 11, 2015
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jul 11, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Spec Compliance 👓 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants