abortcontroller-polyfill
Advanced tools
Comparing version 1.2.8 to 1.2.9
@@ -111,3 +111,7 @@ (function (factory) { | ||
this.listeners = {}; | ||
Object.defineProperty(this, 'listeners', { | ||
value: {}, | ||
writable: true, | ||
configurable: true | ||
}); | ||
} | ||
@@ -178,5 +182,15 @@ | ||
_this2 = _possibleConstructorReturn(this, _getPrototypeOf(AbortSignal).call(this)); | ||
_this2.aborted = false; | ||
_this2.onabort = null; | ||
_this2 = _possibleConstructorReturn(this, _getPrototypeOf(AbortSignal).call(this)); // Compared to assignment, Object.defineProperty makes properties non-enumerable by default and | ||
// we want Object.keys(new AbortController().signal) to be [] for compat with the native impl | ||
Object.defineProperty(_assertThisInitialized(_this2), 'aborted', { | ||
value: false, | ||
writable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(_assertThisInitialized(_this2), 'onabort', { | ||
value: null, | ||
writable: true, | ||
configurable: true | ||
}); | ||
return _this2; | ||
@@ -213,3 +227,9 @@ } | ||
this.signal = new AbortSignal(); | ||
// Compared to assignment, Object.defineProperty makes properties non-enumerable by default and | ||
// we want Object.keys(new AbortController()) to be [] for compat with the native impl | ||
Object.defineProperty(this, 'signal', { | ||
value: new AbortSignal(), | ||
writable: true, | ||
configurable: true | ||
}); | ||
} | ||
@@ -216,0 +236,0 @@ |
@@ -110,3 +110,7 @@ 'use strict'; | ||
this.listeners = {}; | ||
Object.defineProperty(this, 'listeners', { | ||
value: {}, | ||
writable: true, | ||
configurable: true | ||
}); | ||
} | ||
@@ -177,5 +181,15 @@ | ||
_this2 = _possibleConstructorReturn(this, _getPrototypeOf(AbortSignal).call(this)); | ||
_this2.aborted = false; | ||
_this2.onabort = null; | ||
_this2 = _possibleConstructorReturn(this, _getPrototypeOf(AbortSignal).call(this)); // Compared to assignment, Object.defineProperty makes properties non-enumerable by default and | ||
// we want Object.keys(new AbortController().signal) to be [] for compat with the native impl | ||
Object.defineProperty(_assertThisInitialized(_this2), 'aborted', { | ||
value: false, | ||
writable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(_assertThisInitialized(_this2), 'onabort', { | ||
value: null, | ||
writable: true, | ||
configurable: true | ||
}); | ||
return _this2; | ||
@@ -212,3 +226,9 @@ } | ||
this.signal = new AbortSignal(); | ||
// Compared to assignment, Object.defineProperty makes properties non-enumerable by default and | ||
// we want Object.keys(new AbortController()) to be [] for compat with the native impl | ||
Object.defineProperty(this, 'signal', { | ||
value: new AbortSignal(), | ||
writable: true, | ||
configurable: true | ||
}); | ||
} | ||
@@ -215,0 +235,0 @@ |
@@ -110,3 +110,7 @@ 'use strict'; | ||
this.listeners = {}; | ||
Object.defineProperty(this, 'listeners', { | ||
value: {}, | ||
writable: true, | ||
configurable: true | ||
}); | ||
} | ||
@@ -177,5 +181,15 @@ | ||
_this2 = _possibleConstructorReturn(this, _getPrototypeOf(AbortSignal).call(this)); | ||
_this2.aborted = false; | ||
_this2.onabort = null; | ||
_this2 = _possibleConstructorReturn(this, _getPrototypeOf(AbortSignal).call(this)); // Compared to assignment, Object.defineProperty makes properties non-enumerable by default and | ||
// we want Object.keys(new AbortController().signal) to be [] for compat with the native impl | ||
Object.defineProperty(_assertThisInitialized(_this2), 'aborted', { | ||
value: false, | ||
writable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(_assertThisInitialized(_this2), 'onabort', { | ||
value: null, | ||
writable: true, | ||
configurable: true | ||
}); | ||
return _this2; | ||
@@ -212,3 +226,9 @@ } | ||
this.signal = new AbortSignal(); | ||
// Compared to assignment, Object.defineProperty makes properties non-enumerable by default and | ||
// we want Object.keys(new AbortController()) to be [] for compat with the native impl | ||
Object.defineProperty(this, 'signal', { | ||
value: new AbortSignal(), | ||
writable: true, | ||
configurable: true | ||
}); | ||
} | ||
@@ -215,0 +235,0 @@ |
@@ -111,3 +111,7 @@ (function (factory) { | ||
this.listeners = {}; | ||
Object.defineProperty(this, 'listeners', { | ||
value: {}, | ||
writable: true, | ||
configurable: true | ||
}); | ||
} | ||
@@ -178,5 +182,15 @@ | ||
_this2 = _possibleConstructorReturn(this, _getPrototypeOf(AbortSignal).call(this)); | ||
_this2.aborted = false; | ||
_this2.onabort = null; | ||
_this2 = _possibleConstructorReturn(this, _getPrototypeOf(AbortSignal).call(this)); // Compared to assignment, Object.defineProperty makes properties non-enumerable by default and | ||
// we want Object.keys(new AbortController().signal) to be [] for compat with the native impl | ||
Object.defineProperty(_assertThisInitialized(_this2), 'aborted', { | ||
value: false, | ||
writable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(_assertThisInitialized(_this2), 'onabort', { | ||
value: null, | ||
writable: true, | ||
configurable: true | ||
}); | ||
return _this2; | ||
@@ -213,3 +227,9 @@ } | ||
this.signal = new AbortSignal(); | ||
// Compared to assignment, Object.defineProperty makes properties non-enumerable by default and | ||
// we want Object.keys(new AbortController()) to be [] for compat with the native impl | ||
Object.defineProperty(this, 'signal', { | ||
value: new AbortSignal(), | ||
writable: true, | ||
configurable: true | ||
}); | ||
} | ||
@@ -216,0 +236,0 @@ |
@@ -111,3 +111,7 @@ (function (factory) { | ||
this.listeners = {}; | ||
Object.defineProperty(this, 'listeners', { | ||
value: {}, | ||
writable: true, | ||
configurable: true | ||
}); | ||
} | ||
@@ -178,5 +182,15 @@ | ||
_this2 = _possibleConstructorReturn(this, _getPrototypeOf(AbortSignal).call(this)); | ||
_this2.aborted = false; | ||
_this2.onabort = null; | ||
_this2 = _possibleConstructorReturn(this, _getPrototypeOf(AbortSignal).call(this)); // Compared to assignment, Object.defineProperty makes properties non-enumerable by default and | ||
// we want Object.keys(new AbortController().signal) to be [] for compat with the native impl | ||
Object.defineProperty(_assertThisInitialized(_this2), 'aborted', { | ||
value: false, | ||
writable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(_assertThisInitialized(_this2), 'onabort', { | ||
value: null, | ||
writable: true, | ||
configurable: true | ||
}); | ||
return _this2; | ||
@@ -213,3 +227,9 @@ } | ||
this.signal = new AbortSignal(); | ||
// Compared to assignment, Object.defineProperty makes properties non-enumerable by default and | ||
// we want Object.keys(new AbortController()) to be [] for compat with the native impl | ||
Object.defineProperty(this, 'signal', { | ||
value: new AbortSignal(), | ||
writable: true, | ||
configurable: true | ||
}); | ||
} | ||
@@ -216,0 +236,0 @@ |
{ | ||
"name": "abortcontroller-polyfill", | ||
"version": "1.2.8", | ||
"version": "1.2.9", | ||
"description": "Polyfill/ponyfill for the AbortController DOM API + optional patching of fetch (stub that calls catch, doesn't actually abort request).", | ||
@@ -5,0 +5,0 @@ "main": "dist/umd-polyfill.js", |
class Emitter { | ||
constructor() { | ||
this.listeners = {}; | ||
Object.defineProperty(this, 'listeners', { value: {}, writable: true, configurable: true }); | ||
} | ||
@@ -41,5 +41,6 @@ addEventListener(type, callback) { | ||
super(); | ||
this.aborted = false; | ||
this.onabort = null; | ||
// Compared to assignment, Object.defineProperty makes properties non-enumerable by default and | ||
// we want Object.keys(new AbortController().signal) to be [] for compat with the native impl | ||
Object.defineProperty(this, 'aborted', { value: false, writable: true, configurable: true }); | ||
Object.defineProperty(this, 'onabort', { value: null, writable: true, configurable: true }); | ||
} | ||
@@ -63,3 +64,5 @@ toString() { | ||
constructor() { | ||
this.signal = new AbortSignal(); | ||
// Compared to assignment, Object.defineProperty makes properties non-enumerable by default and | ||
// we want Object.keys(new AbortController()) to be [] for compat with the native impl | ||
Object.defineProperty(this, 'signal', { value: new AbortSignal(), writable: true, configurable: true }); | ||
} | ||
@@ -66,0 +69,0 @@ abort() { |
78332
1879