summaryrefslogtreecommitdiffstats
path: root/packages/markdown/marked/docs/demo/worker.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/markdown/marked/docs/demo/worker.js')
-rw-r--r--packages/markdown/marked/docs/demo/worker.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/markdown/marked/docs/demo/worker.js b/packages/markdown/marked/docs/demo/worker.js
index 06b8befe..6a0fa032 100644
--- a/packages/markdown/marked/docs/demo/worker.js
+++ b/packages/markdown/marked/docs/demo/worker.js
@@ -1,4 +1,4 @@
-/* globals marked, unfetch, ES6Promise */
+/* globals marked, unfetch, ES6Promise, Promise */ // eslint-disable-line no-redeclare
if (!self.Promise) {
self.importScripts('https://cdn.jsdelivr.net/npm/es6-promise/dist/es6-promise.js');
self.Promise = ES6Promise;
@@ -11,15 +11,15 @@ if (!self.fetch) {
var versionCache = {};
var currentVersion;
-onunhandledrejection = function (e) {
+onunhandledrejection = function(e) {
throw e.reason;
};
-onmessage = function (e) {
+onmessage = function(e) {
if (e.data.version === currentVersion) {
parse(e);
} else {
- loadVersion(e.data.version).then(function () {
+ loadVersion(e.data.version).then(function() {
parse(e);
});
}
@@ -87,13 +87,13 @@ function loadVersion(ver) {
promise = Promise.resolve(versionCache[ver]);
} else {
promise = fetch(ver)
- .then(function (res) { return res.text(); })
- .then(function (text) {
+ .then(function(res) { return res.text(); })
+ .then(function(text) {
versionCache[ver] = text;
return text;
});
}
- return promise.then(function (text) {
+ return promise.then(function(text) {
try {
// eslint-disable-next-line no-new-func
Function(text)();