We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
class Test @test = 1
causes a compiler error
Syntax error on line 2, column 2: unexpected '@' (\u0040) 1 : class Test 2 : @test = 1
The text was updated successfully, but these errors were encountered:
Dynamix, you'll have to correct me if I'm wrong, but it looks like you should use the following syntax:
class Test test: 1 testing = new Test() console.log(testing.test) # => 1
When declaring a class, we pass an object as a parameter (which can be hard to tell, with (coffee/ember)script's minimal syntax.
The above is equivalent to:
class Test ( { test: 1} )
Which sets the test property on the Test class, which you can then access with @test:
test
Test
@test
class Test test: 1 testAccess: -> console.log( @test ) testing = new Test() testing.testAccess() # => 1
Sorry, something went wrong.
Thanks for the response. However this is not the same as a static member in coffeescript (good explanation here : http://www.cs8.my/2012/09/coffeescript-classes-and-their-variables/). Seems like this is missing in coffeescript-redux.
Oh yep, I hadn't seen that @var = "stuff" syntax before. Doing it with a colon also breaks. Bummer
@var = "stuff"
No branches or pull requests
causes a compiler error
The text was updated successfully, but these errors were encountered: