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

83.33% Statements 30/36
52.63% Branches 10/19
88.89% Functions 8/9
90.32% Lines 28/31
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                            14× 14× 14× 12× 14×          
/*!
 * @author electricessence / https://github.com/electricessence/
 * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md
 */
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
(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", "./SimpleEnumerableBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    var SimpleEnumerableBase_1 = require("./SimpleEnumerableBase");
    var VOID0 = void 0;
    var InfiniteEnumerator = (function (_super) {
        __extends(InfiniteEnumerator, _super);
        function InfiniteEnumerator(_factory) {
            _super.call(this);
            this._factory = _factory;
        }
        InfiniteEnumerator.prototype.canMoveNext = function () {
            return this._factory != null;
        };
        InfiniteEnumerator.prototype.moveNext = function () {
            var _ = this;
            var f = _._factory;
            if (f)
                _._current = f(_._current, _.incrementIndex());
            return f != VOID0;
        };
        InfiniteEnumerator.prototype.dispose = function () {
            _super.prototype.dispose.call(this);
            this._factory = VOID0;
        };
        return InfiniteEnumerator;
    }(SimpleEnumerableBase_1.SimpleEnumerableBase));
    exports.InfiniteEnumerator = InfiniteEnumerator;
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.default = InfiniteEnumerator;
});
//# sourceMappingURL=InfiniteEnumerator.js.map