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

Feature: "function exports.name" #116

Closed
apaleslimghost opened this issue Mar 28, 2012 · 4 comments
Closed

Feature: "function exports.name" #116

apaleslimghost opened this issue Mar 28, 2012 · 4 comments

Comments

@apaleslimghost
Copy link

Would be sugar for exports.name = name = function name, just as with class.

@satyr
Copy link
Owner

satyr commented Mar 28, 2012

Would require large changes in lexer/grammar.

Instead maybe we can add export keyword:

export function name then

compiling to:

var __out = typeof exports != 'undefined' && exports || this;
__out.name = name;
function name(){}

@apaleslimghost
Copy link
Author

I realise it's just wishful thinking at this point, but the same or similar grammar would allow function @name for class functions.

@satyr
Copy link
Owner

satyr commented Apr 2, 2012

@name = function then ... should do in that case.

@apaleslimghost
Copy link
Author

Ah, didn't realise that would keep the name on the function, which also works for exports.name and was basically the point of this issue. I'm closing it.

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

No branches or pull requests

2 participants