#1396 closed enhancement (invalid)
Documentation on Statics?
Reported by: | Statics | Owned by: | sjmiles |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Core | Version: | 0.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
In the documentation it says that doing something like this:
dojo.declare("test", null, {
statics: {
counter: 0
},
});
Results in counter being static.
So I tested it like this:
test1 = new test(); test2 = new test(); alert(test1.statics.counter); alert((test1.statics.counter+1)); alert(test2.statics.counter);
counter is 0, then 1, then 0 again....
If counter were static, it should have been 1 on the last alert...
Change History (4)
comment:1 Changed 15 years ago by
Component: | General → Core |
---|---|
Milestone: | → 0.4 |
Owner: | changed from anonymous to sjmiles |
comment:2 Changed 15 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:3 Changed 15 years ago by
Geez - Sorry - Doh!...Thanks! I'm going to go back to school and retake basic now.
Note: See
TracTickets for help on using
tickets.
The expression
does not change the value of the variable; probably you wanted to say test1.statidcs.counter++. Anyway, please see a book about javascript programming (or books on other programming languages) for more details.