Created
July 23, 2011 14:49
-
-
Save lucaspiller/1101508 to your computer and use it in GitHub Desktop.
CoffeeScript Bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Model | |
CONST_A: 1 | |
CONST_B: 2 | |
CONSTS: [@CONST_A, @CONST_B] | |
m = new Model | |
# => Model | |
m.CONST_A | |
# => 1 | |
m.CONST_A | |
# => 2 | |
m.CONSTS | |
# => [undefined, undefined] | |
# Expected [1, 2] |
autotelicum
commented
Jul 23, 2011
Ah ha! Thanks!
…On Jul 23, 2011 4:42 PM, "autotelicum" < ***@***.***> wrote:
``` coffeescript
# Workaround
show = alert # console.log
class Model
CONST_A: 1
CONST_B: 2
CONSTS: [@::CONST_A, @::CONST_B]
m = new Model
# => Model
show m.CONST_A
# => 1
show m.CONST_B
# => 2
show m.CONSTS
# => [1, 2]
```
##
Reply to this email directly or view it on GitHub:
https://gist.github.com/1101508
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment