rhino/testsrc/doctests/Counter.doctest
raw| 1 | // This Source Code Form is subject to the terms of the Mozilla Public |
| 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 4 | |
| 5 | js> defineClass("Counter") |
| 6 | js> c = new Counter(7) |
| 7 | [object Counter] |
| 8 | js> c.count |
| 9 | 7 |
| 10 | js> c.count |
| 11 | 8 |
| 12 | js> c.count |
| 13 | 9 |
| 14 | js> c.resetCount() |
| 15 | js> c.count |
| 16 | 0 |