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

Fat arrow method in namespaced class causes syntax error #2

Open
vjpr opened this issue Feb 25, 2012 · 0 comments
Open

Fat arrow method in namespaced class causes syntax error #2

vjpr opened this issue Feb 25, 2012 · 0 comments

Comments

@vjpr
Copy link

vjpr commented Feb 25, 2012

#app.coffee

class S.Application
  test: =>

Generates:

var S.Application = function() {
  this.test = __bind(this.test, this);
};

and causes the following error:

ERROR - Parse error. missing ; before statement
var S.Application = function() {
       ^

app/assets/javascripts/app.coffee.js:14: ERROR - Parse error. syntax error
  this.test = __bind(this.test, this);
        ^

app/assets/javascripts/app.coffee.js:15: ERROR - Parse error. syntax error
};
 ^

Regular coffeescript generates the following:

S.Application = (function() {

    function Application() {
      this.test = __bind(this.test, this);
    }

}

How would I fix this?

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

1 participant