Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#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 13 years ago by dylan

Component: GeneralCore
Milestone: 0.4
Owner: changed from anonymous to sjmiles

comment:2 Changed 13 years ago by bill

Resolution: invalid
Status: newclosed

The expression

test1.statics.counter+1

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.

comment:3 Changed 13 years ago by ole_ersoy@…

Geez - Sorry - Doh!...Thanks! I'm going to go back to school and retake basic now.

comment:4 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.