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

Do not put a space within function* generator functions. #428

Closed
ckknight opened this issue Mar 19, 2014 · 4 comments
Closed

Do not put a space within function* generator functions. #428

ckknight opened this issue Mar 19, 2014 · 4 comments

Comments

@ckknight
Copy link

In ECMAScript 6, there is support for generator functions in the following form:

function* generate() {
  yield 1;
  yield 2;
}

or

var generate = function* () {
  yield 1;
  yield 2;
}

Unless I'm mistaken, there isn't a way to prevent a space from being inserted between function and *, which is what I would like to have.

Ideally, this would be an option so that users can choose between function* name() {}, function *name() {}, function*name() {}, and function * name() {} - though I prefer the former.

Along these lines, unnamed function expressions should be supported in a similar fashion, i.e. function* () {}, function*() {}, function *() {}, function * () {}.

@Kingles
Copy link

Kingles commented Mar 31, 2014

+1

This would be awesome for co and koa.

@bitwiseman
Copy link
Member

I think implementing support for function* name() {} and function* () {} would be enough for now. The option to control it would come later.

@villadora
Copy link

+1 That would be reallly useful.

@haoxins
Copy link
Contributor

haoxins commented Apr 30, 2014

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants