[Pkg-javascript-commits] [node-async] 235/480: because globals suck :(

Jonas Smedegaard js at moszumanska.debian.org
Fri May 2 08:58:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository node-async.

commit 17d398b1191e2cd9d59c5b08904fa8090798b96f
Author: ashnur <ashnur at gmail.com>
Date:   Wed Jan 30 09:34:50 2013 +0200

    because globals suck :(
    
    I had a bit of a trouble today when I tried to run async in an env where the root wasn't the window.  
---
 lib/async.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/async.js b/lib/async.js
index bbbd05c..1b29a27 100644
--- a/lib/async.js
+++ b/lib/async.js
@@ -683,14 +683,14 @@
     };
 
     // AMD / RequireJS
-    if (typeof define !== 'undefined' && define.amd) {
-        define('async', [], function () {
+    if (typeof root.define !== 'undefined' && root.define.amd) {
+        root.define('async', [], function () {
             return async;
         });
     }
     // Node.js
-    else if (typeof module !== 'undefined' && module.exports) {
-        module.exports = async;
+    else if (typeof root.module !== 'undefined' && root.module.exports) {
+        root.module.exports = async;
     }
     // included directly via <script> tag
     else {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-async.git



More information about the Pkg-javascript-commits mailing list