CoffeeScript缩进错误

时间:2011-08-31 15:01:13

标签: javascript coffeescript

知道为什么在编译时会出错?

(window) ->

    # pubsub
    App.publish = (topic,args) ->
        App.subscriptions[topic] and $.each(App.subscriptions[topic], ->
            this.apply(App, args or [])

http://jsfiddle.net/wesbos/4Kf2B/

1 个答案:

答案 0 :(得分:0)

没关系,我很傻,忘了删除paren:\

(窗口) - >

# pubsub
App.publish = (topic,args) ->
    App.subscriptions[topic] and $.each App.subscriptions[topic], ->
        this.apply(App, args or [])