Skip to content

Prototype and the existential operator #2508

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

Closed
thedufer opened this issue Aug 23, 2012 · 3 comments
Closed

Prototype and the existential operator #2508

thedufer opened this issue Aug 23, 2012 · 3 comments

Comments

@thedufer
Copy link

Combining the prototype shortcut and the existential operator seems like fairly unambiguous code, but CoffeeScript complains UNEXPECTED '::':

Foo?::foobar
Foo.bar?::foobar

From these I would expect the same compiled code as from

Foo?.prototype.foobar
Foo.bar?.prototype.foobar
@michaelficarra
Copy link
Collaborator

Fixed in CoffeeScriptRedux:

$ bin/coffee -bj --cli 'b = a?::b'
// Generated by CoffeeScript 2.0.0
var b;
b = 'undefined' !== typeof a && null != a ? a.prototype.b : void 0;

@mark-hahn
Copy link

How is 2.0 coming along?

@michaelficarra
Copy link
Collaborator

@mark-hahn: Pretty well. Try it out: https://github.com/michaelficarra/CoffeeScriptRedux

Check out the wiki for roadmap/progress.

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

4 participants