开发者

CoffeeScript Indent Error

开发者 https://www.devze.com 2023-03-31 20:27 出处:网络
Any idea why this would throw an error when compiling? (window) -> # pubsub App.publish = (topic,args) ->

Any idea why this would throw an error when compiling?

(window) ->

    # pubsub
    App.publish = (topic,args) ->
        App.subscriptions[to开发者_开发问答pic] and $.each(App.subscriptions[topic], ->
            this.apply(App, args or [])

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


Never mind, I'm silly and forgot a remove paren :\

(window) ->

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

精彩评论

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