]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Add specific check for "require" in hasModule check (fixes bug when using with QUnit). 1238/head
authorJonny Gerig Meyer <jonny@oddbird.net>
Wed, 30 Oct 2013 00:01:24 +0000 (18:01 -0600)
committerJonny Gerig Meyer <jonny@oddbird.net>
Wed, 30 Oct 2013 00:01:24 +0000 (18:01 -0600)
moment.js

index 9e7126e091faa226df3e4a3d3511ed201c21320a..4858e241bb1760a2ed0928b951c2b9a0191c3630 100644 (file)
--- a/moment.js
+++ b/moment.js
@@ -27,7 +27,7 @@
         languages = {},
 
         // check for nodeJS
-        hasModule = (typeof module !== 'undefined' && module.exports),
+        hasModule = (typeof module !== 'undefined' && module.exports && typeof require !== 'undefined'),
 
         // ASP.NET json date format regex
         aspNetJsonRegex = /^\/?Date\((\-?\d+)/i,