1
1
go ( [ "_reporter" , "require" ] , function ( amdJS , require ) {
2
2
3
- function emptyDeps ( then ) {
4
- define ( 'emptyDeps' , [ ] , function ( ) {
5
- amdJS . assert ( arguments . length === 0 , 'basic_empty_deps: [] should be treated as no dependencies instead of the default require, exports, module' ) ;
6
- then ( ) ;
7
- } ) ;
8
- }
9
-
10
- function noDeps ( then ) {
11
- define ( 'noDeps' , function ( require , exports , module ) {
12
- amdJS . assert ( typeof ( require ) === 'function' , 'basic_empty_deps: no dependencies case uses require in first slot. Is a function' ) ;
13
- amdJS . assert ( typeof ( exports ) === 'object' , 'basic_empty_deps: no dependencies case uses exports in second slot. Is an object.' ) ;
14
- amdJS . assert ( typeof ( module ) === 'object' , 'basic_empty_deps: no dependencies case uses module in third slot. Is an object.' ) ;
15
- then ( ) ;
16
- } ) ;
17
- }
3
+ // tests if there are empty dependencies, no arguments are
4
+ // available in the factory's method
5
+ define ( 'emptyDeps' , [ ] , function ( ) {
6
+ amdJS . assert ( arguments . length === 0 , 'basic_empty_deps: [] should be treated as no dependencies instead of the default require, exports, module' ) ;
7
+ } ) ;
18
8
19
- // this nesting structure ensures that the AMD define will resolve
20
- // before we call the next by after the tests are ran in each use
21
- // case. We use named define calls to ensure there are not module
22
- // conflicts or mismatches that can occur using anonymous modules.
23
- emptyDeps ( function ( ) {
24
- window . setTimeout ( function ( ) {
25
- noDeps ( function ( ) {
26
- window . setTimeout ( function ( ) {
27
- amdJS . print ( 'DONE' , 'done' ) ;
28
- } ) ;
29
- } ) ;
9
+ window . setTimeout ( function ( ) {
10
+ require ( [ 'emptyDeps' ] , function ( ) {
11
+ amdJS . print ( 'DONE' , 'done' ) ;
30
12
} ) ;
31
13
} ) ;
32
-
33
- } ) ;
14
+ } ) ;
0 commit comments