]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Merge pull request #1589 from ichernev/remove-node-global
authorIsaac Cambron <isaac@isaaccambron.com>
Fri, 4 Apr 2014 17:43:54 +0000 (13:43 -0400)
committerIsaac Cambron <isaac@isaaccambron.com>
Fri, 4 Apr 2014 17:43:54 +0000 (13:43 -0400)
Do not export a global in node.js

1  2 
moment.js

diff --cc moment.js
index e8222753792b3a25e970308972f30d9daef62d4c,85a971e4088e096fa94c580656e55f24308b1eaf..c4dbbdeea2e7183667aaa06345c00d1663732fb8
+++ b/moment.js
      // CommonJS module is defined
      if (hasModule) {
          module.exports = moment;
-         makeGlobal(true);
      } else if (typeof define === "function" && define.amd) {
          define("moment", function (require, exports, module) {
 -            if (module.config && module.config() && module.config().noGlobal !== true) {
 -                // If user provided noGlobal, he is aware of global
 -                makeGlobal(module.config().noGlobal === undefined);
 +            if (module.config && module.config() && module.config().noGlobal === true) {
 +                // release the global variable
 +                globalScope.moment = oldGlobalMoment;
              }
  
              return moment;