make commonjs api work with non-global module, expose amd api

This commit is contained in:
Leo Horie 2014-03-30 14:17:40 -04:00
parent d258b9687b
commit 78c422448a

View file

@ -417,7 +417,8 @@ new function(window) {
} }
} }
if (window.module) window.module.exports = m if (typeof module != "undefined" && module !== null) module.exports = m
if (typeof define == "function" && define.amd) define(function() {return m})
//testing API //testing API
m.deps = function(mock) {return window = mock} m.deps = function(mock) {return window = mock}