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

Add option to enable function names #1459

Closed
lilyball opened this issue Jun 22, 2011 · 5 comments
Closed

Add option to enable function names #1459

lilyball opened this issue Jun 22, 2011 · 5 comments

Comments

@lilyball
Copy link

I know function names are disabled because of an IE bug (#366), but I'm targeting node.js with my script and I would absolutely love to have function names for debugging purposes. Could we possibly get an option to turn function names back on when compiling/interpreting a script, if we know we will never be executed by IE?

@mark-hahn
Copy link

What debugger are you using? The ones I'm aware of work fine without the functions being named. They get the name from context.

@jashkenas
Copy link
Owner

Nope -- CoffeeScript wants to generate JavaScript that runs correctly everywhere, not JavaScript that runs correctly in most places, but then fails in mysterious ways in IE.

@lilyball
Copy link
Author

Define "everywhere". When I'm writing Node.js code, it's already limited to only running via Node.js. It will fail to work in any other context. Node.js doesn't use the IE engine. Given this, why should my Node.js code be restricted based on limitations in IE?

I recognize the value of having the default output of CoffeeScript work in all JS engines, but it's obviously the case that not all code is going to care about this property. CoffeeScript already has a -b flag in order to behave better when writing Node.js modules. Is it really that unreasonable to ask for another flag that instructs CoffeeScript that I don't need IE compatibility?

@michaelficarra
Copy link
Collaborator

@kballard: the CoffeeScript compiler has a single compilation target right now. In order to support a flag that changes the compilation target form this available-in-all-major-JS-implementations subset of JS to which we currently compile, we would have to redesign a lot of the compiler to separate the code generation process from the AST structures themselves. I plan to do this with my compiler, but that won't be available for quite some time now.

@devinrhode2
Copy link

Perhaps a year later?

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