( id, factory, args )
| 41 | |
| 42 | // 设置module, 兼容CommonJs写法。 |
| 43 | setModule = function( id, factory, args ) { |
| 44 | var module = { |
| 45 | exports: factory |
| 46 | }, |
| 47 | returned; |
| 48 | |
| 49 | if ( typeof factory === 'function' ) { |
| 50 | args.length || (args = [ _require, module.exports, module ]); |
| 51 | returned = factory.apply( null, args ); |
| 52 | returned !== undefined && (module.exports = returned); |
| 53 | } |
| 54 | |
| 55 | modules[ id ] = module.exports; |
| 56 | }, |
| 57 | |
| 58 | // 根据id获取module |
| 59 | getModule = function( id ) { |