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

setTimeout / setInterval don't compile #36

Open
coladarci opened this issue Mar 19, 2014 · 1 comment
Open

setTimeout / setInterval don't compile #36

coladarci opened this issue Mar 19, 2014 · 1 comment

Comments

@coladarci
Copy link

This is valid coffeescript..

    setTimeout ->
      alert("OH HAI!")
    , 500

..but throws a compilation error in ember-script:

Error: Syntax error on line 140, column 4: unexpected ',' (\u002C)
137 : 
138 :     setTimeout(->
139 :       alert("OH HAI!")
140 :     , 500)

I've tried this:

    setTimeout (->
      alert("OH HAI!")
    , 500)

With the same results.

For those with the same issue, the only work around I've found is doing something like this (which does have it's own advantages):

timeoutFunction = ->
  alert("OH HAI!")
setTimeout(timeoutFunction, 500)
@ghempton
Copy link
Owner

EmberScript is based on coffeescript redux. Most of these issues that are related to coffeescript will hopefully eventually be fixed upstream. Here is a relevant issue: michaelficarra/CoffeeScriptRedux#262

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

2 participants