all files / TypeScript.NET/source/System/Collections/Enumeration/ SimpleEnumerableBase.js

75% Statements 30/40
33.33% Branches 6/18
61.54% Functions 8/13
76.32% Lines 29/38
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74                                  12× 12× 12×   13× 13×                                                      
/*!
 * @author electricessence / https://github.com/electricessence/
 * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md
 */
(function (factory) {
    Eif (typeof module === 'object' && typeof module.exports === 'object') {
        var v = factory(require, exports); Iif (v !== undefined) module.exports = v;
    }
    else if (typeof define === 'function' && define.amd) {
        define(["require", "exports", "./IteratorResult"], factory);
    }
})(function (require, exports) {
    "use strict";
    var IteratorResult_1 = require("./IteratorResult");
    var VOID0 = void 0;
    var SimpleEnumerableBase = (function () {
        function SimpleEnumerableBase() {
            this.reset();
        }
        Object.defineProperty(SimpleEnumerableBase.prototype, "current", {
            get: function () {
                return this._current;
            },
            enumerable: true,
            configurable: true
        });
        SimpleEnumerableBase.prototype.incrementIndex = function () {
            var i = this._index;
            this._index = i = i === VOID0 ? 0 : (i + 1);
            return i;
        };
        SimpleEnumerableBase.prototype.nextValue = function () {
            this.moveNext();
            return this._current;
        };
        SimpleEnumerableBase.prototype.next = function () {
            return this.moveNext()
                ? new IteratorResult_1.IteratorResult(this._current, this._index)
                : IteratorResult_1.IteratorResult.Done;
        };
        SimpleEnumerableBase.prototype['return'] = function (value) {
            try {
                return value !== VOID0 && this.canMoveNext()
                    ? new IteratorResult_1.IteratorResult(value, VOID0, true)
                    : IteratorResult_1.IteratorResult.Done;
            }
            finally {
                this.dispose();
            }
        };
        SimpleEnumerableBase.prototype.reset = function () {
            this._current = VOID0;
            this._index = VOID0;
        };
        SimpleEnumerableBase.prototype.dispose = function () {
            this.reset();
        };
        SimpleEnumerableBase.prototype.getIsEndless = function () {
            return this.canMoveNext();
        };
        Object.defineProperty(SimpleEnumerableBase.prototype, "isEndless", {
            get: function () {
                return this.getIsEndless();
            },
            enumerable: true,
            configurable: true
        });
        return SimpleEnumerableBase;
    }());
    exports.SimpleEnumerableBase = SimpleEnumerableBase;
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.default = SimpleEnumerableBase;
});
//# sourceMappingURL=SimpleEnumerableBase.js.map