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

[babylon] Add support for @@iterator #7053

Closed
bcherny opened this issue Dec 19, 2017 · 2 comments · Fixed by #7058
Closed

[babylon] Add support for @@iterator #7053

bcherny opened this issue Dec 19, 2017 · 2 comments · Fixed by #7058
Labels
Has PR outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@bcherny
Copy link
Contributor

bcherny commented Dec 19, 2017

Choose one: feature request

Input Code

/* @flow */

declare class A {
  @@iterator(): Iterator<File>;
}

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

import { parse } from 'babylon'
import { readFileSync } from 'fs'

let code = readFileSync('file.flow.js', 'utf-8')
let ast = parse(code, { plugins: ['flow'], sourceType: 'module' }) // SyntaxError: Unexpected token

Expected Behavior

@@iterator should be parsed into an Identifier.

Current Behavior

Babylon throws a SyntaxError.

Context

Attempting to use Babylon to parse flow/dom.js (error is thrown on line 55).

Your Environment

software version(s)
Babel Master (68476b6)
Babylon Master (68476b6)
node 8.1.3
npm 5.3.0
Operating System OSX
@babel-bot
Copy link
Collaborator

Hey @bcherny! 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.

@rajasekarm
Copy link
Member

This should be a small change. I'll give a PR today.

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 3, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Has PR 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.

4 participants