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

coffeescript compatibility #5

Closed
heartsentwined opened this issue Apr 6, 2013 · 4 comments
Closed

coffeescript compatibility #5

heartsentwined opened this issue Apr 6, 2013 · 4 comments

Comments

@heartsentwined
Copy link

Does ember-script preserve the full set of coffeescript syntax?

I tried it today and the compiler caught a couple of unexpected errors (all compiling fine in coffee-script:

ActionView::Template::Error (Error: Syntax error on line 84, column 5: unexpected '.' (\u002E)
81 : 
82 :     $.ajax
83 :       url: 'foo'
84 :     .done ->
^^ :~~~~^
85 :       doSomething()
86 : 

An explicit bracket resolves the above:

    $.ajax(
      url: 'foo'
    ).done ->
      doSomething()
ActionView::Template::Error (Error: Syntax error on line 18, column 19: unexpected '=' (\u003D)
17 : 
18 :     if foo && bar = 'value'
^^ :~~~~~~~~~~~~~~~~~~~^
19 :       doSomething()

Again an explicit bracket resolves it:

    if foo && (bar = 'value')
      doSomething()
@machty
Copy link
Contributor

machty commented Apr 6, 2013

These may very well be related to CoffeeScriptRedux rather than EmberScript. One of CSR's aims is to iron out any of the corner case language quirks of the original CS compiler, and these changes might be the result of it. That said, I am surprised that your ajax example doesn't work...

@heartsentwined
Copy link
Author

Thanks @machty, I'll give CSR a try, and possibly move this issue over there.

@heartsentwined
Copy link
Author

@heartsentwined
Copy link
Author

The other one is a new issue, opened at michaelficarra/CoffeeScriptRedux#189.

Closing and my apologies, I didn't realize this would be related to general issues from CSR - I thought it would be 100% backwards compatible.

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