Skip to content

coffeescript compatibility #5

Description

@heartsentwined

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()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions