Skip to content

Fix: Fat arrow method in namespaced class causes syntax error#1

Open
vjpr wants to merge 21 commits intosmhanov:masterfrom
vjpr:master
Open

Fix: Fat arrow method in namespaced class causes syntax error#1
vjpr wants to merge 21 commits intosmhanov:masterfrom
vjpr:master

Conversation

@vjpr
Copy link

@vjpr vjpr commented Feb 26, 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);
    }

}

There was a small change to get this working again but I am not sure if it will break something else. Would be good if you could take a second look.

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

Successfully merging this pull request may close these issues.

1 participant