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 and await in class methods keys #8300

Closed
nicolo-ribaudo opened this issue Jul 10, 2018 · 1 comment · Fixed by #13600
Closed

Yield and await in class methods keys #8300

nicolo-ribaudo opened this issue Jul 10, 2018 · 1 comment · Fixed by #13600
Labels
i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue Spec: Classes

Comments

@nicolo-ribaudo
Copy link
Member

Bug Report

Current Behavior
Babel generates invalid code (yield or await inside a normal function)

Input Code

  • REPL or Repo link if applicable:
function* f() {
  return class A {
    [yield 0]() {
      return 3;
    }
  }
}

var buildClass = f();
buildClass.next();
var A = buildClass.next("foo").value;
alert(new A().foo());

Expected behavior/code
It should alert 3

Babel Configuration (.babelrc, package.json, cli command)

preset-env

Environment

  • Babel version(s): v7.0.0-beta.52

Possible Solution
a) Compute the keys before the IIFE
b) Make the iife the correct function type

Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.

nicolo-ribaudo added a commit to nicolo-ribaudo/babel that referenced this issue Jul 10, 2018
NOTE: This doesn't work for decorators inside the class body, like in
      babel#8300
nicolo-ribaudo added a commit to nicolo-ribaudo/babel that referenced this issue Jul 28, 2018
NOTE: This doesn't work for decorators inside the class body, like in
      babel#8300
nicolo-ribaudo added a commit to nicolo-ribaudo/babel that referenced this issue Aug 17, 2018
NOTE: This doesn't work for decorators inside the class body, like in
      babel#8300
@nicolo-ribaudo
Copy link
Member Author

NOTE: Also class methods/fields decorators.

@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 Oct 26, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue Spec: Classes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant