summaryrefslogtreecommitdiffstats
path: root/debian/tests/test_modules/abort-controller/polyfill.js
diff options
context:
space:
mode:
Diffstat (limited to 'debian/tests/test_modules/abort-controller/polyfill.js')
-rw-r--r--debian/tests/test_modules/abort-controller/polyfill.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/debian/tests/test_modules/abort-controller/polyfill.js b/debian/tests/test_modules/abort-controller/polyfill.js
new file mode 100644
index 0000000..3ca8923
--- /dev/null
+++ b/debian/tests/test_modules/abort-controller/polyfill.js
@@ -0,0 +1,21 @@
+/*globals require, self, window */
+"use strict"
+
+const ac = require("./dist/abort-controller")
+
+/*eslint-disable @mysticatea/prettier */
+const g =
+ typeof self !== "undefined" ? self :
+ typeof window !== "undefined" ? window :
+ typeof global !== "undefined" ? global :
+ /* otherwise */ undefined
+/*eslint-enable @mysticatea/prettier */
+
+if (g) {
+ if (typeof g.AbortController === "undefined") {
+ g.AbortController = ac.AbortController
+ }
+ if (typeof g.AbortSignal === "undefined") {
+ g.AbortSignal = ac.AbortSignal
+ }
+}