WGShare.Client.Wx/miniprogram_npm/signalr-for-wx/AbortController.js

40 lines
1.2 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 版权所有c.NET基金会。保留所有权利。
// 在2.0版Apache许可下授权。有关许可证信息请参见项目根目录中的License.txt。
//粗略填写 https://developer.mozilla.org/en-US/docs/Web/API/AbortController
//实际上我们从来没有使用被polyfill填充的API我们总是使用polyfill因为
//它现在还是一个非常新的API。
/**
*
* @private
*/
var AbortController = /** @class */ (function () {
function AbortController() {
this.isAborted = false;
this.onabort = null;
}
AbortController.prototype.abort = function () {
if (!this.isAborted) {
this.isAborted = true;
if (this.onabort) {
this.onabort();
}
}
};
Object.defineProperty(AbortController.prototype, "signal", {
get: function () {
return this;
},
enumerable: true,
configurable: true
});
Object.defineProperty(AbortController.prototype, "aborted", {
get: function () {
return this.isAborted;
},
enumerable: true,
configurable: true
});
return AbortController;
}());
export { AbortController };