开发者

Issues compiling Coffeescript

I have a really simple coffescript class:

class Bar
   foo: ->
      console.log('bar')

Which when compiled using coffee -c bar.coffee is being compiled into

(function() {
  class(Bar({
    f开发者_运维知识库oo: function() {
      return console.log('bar');
    }
  }));
}).call(this);

If it makes any difference I'm in Windows and the exact same coffeescript compiles correctly using SassAndCoffee. I have tried a number of different compilers (Node.exe + latest coffescript source, Coffee.exe, etc) but all are showing the same behaviour. Has anyone got any thoughts?


James, check and see if you have unusual whitespace in your code that's confusing Coffeescript's parser. Since Coffeescript is a whitespace-delimited language (usually), a tabs-vs-spaces mistake might be the source of your error.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜