UNPKG

@reactivex/ix-es2015-cjs

Version:

The Interactive Extensions for JavaScript

33 lines (31 loc) 1.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.throwIfAborted = exports.AbortError = void 0; const isiterable_js_1 = require("./util/isiterable.js"); /** @ignore */ class AbortError extends Error { constructor(message = 'The operation has been aborted') { super(message); Object.setPrototypeOf(this, AbortError.prototype); Error.captureStackTrace(this, this.constructor); this.name = 'AbortError'; } get [Symbol.toStringTag]() { return 'AbortError'; } } exports.AbortError = AbortError; function throwIfAborted(signal) { if (signal && signal.aborted) { throw new AbortError(); } } exports.throwIfAborted = throwIfAborted; Object.defineProperty(AbortError, Symbol.hasInstance, { writable: true, configurable: true, value(x) { return ((0, isiterable_js_1.isObject)(x) && (x.constructor.name === 'AbortError' || x[Symbol.toStringTag] === 'AbortError')); }, }); //# sourceMappingURL=aborterror.js.map