Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/asap/browser-raw.js')
-rw-r--r--node_modules/asap/browser-raw.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/node_modules/asap/browser-raw.js b/node_modules/asap/browser-raw.js
index 1cfd77293..9cee7e32e 100644
--- a/node_modules/asap/browser-raw.js
+++ b/node_modules/asap/browser-raw.js
@@ -76,9 +76,12 @@ function flush() {
// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that
// have WebKitMutationObserver but not un-prefixed MutationObserver.
-// Must use `global` instead of `window` to work in both frames and web
+// Must use `global` or `self` instead of `window` to work in both frames and web
// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.
-var BrowserMutationObserver = global.MutationObserver || global.WebKitMutationObserver;
+
+/* globals self */
+var scope = typeof global !== "undefined" ? global : self;
+var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;
// MutationObservers are desirable because they have high priority and work
// reliably everywhere they are implemented.