(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var TransientDisposable = /** @class */ (function () {
        function TransientDisposable(owner) {
            if (owner) {
                this.registerIn(owner);
            }
        }
        TransientDisposable.prototype.registerIn = function (value) {
            var v = value.disposables;
            if (v) {
                v.push(this);
            }
            else {
                if (value.registerDisposable) {
                    value.registerDisposable(this);
                }
            }
        };
        return TransientDisposable;
    }());
    exports.default = TransientDisposable;
});
//# sourceMappingURL=TransientDisposable.js.map