@@ -41,10 +41,15 @@ class System {
41
41
}
42
42
return ( this . asyncModules [ id ] = await this . fetchModule ( id ) ) ;
43
43
}
44
+ debugger ;
44
45
throw new Error ( `no module: "${ id } "` ) ;
45
46
}
46
47
47
- async resolveExports ( ids ) {
48
+ async resolveExports ( ...ids ) {
49
+ if ( ! Array . isArray ( ids ) ) {
50
+ debugger ;
51
+ throw new Error ( 'Expected array of ids, got: ' + ids ) ;
52
+ }
48
53
return Promise . all (
49
54
ids . map ( async ( id ) => {
50
55
id = this . normalize ( id ) ;
@@ -67,9 +72,9 @@ class System {
67
72
exports [ key ] = value ;
68
73
}
69
74
70
- const $__moduleContext = { id } ;
75
+ const $__moduleContext = { id } ;
71
76
try {
72
- const { setters, execute } = await func (
77
+ const { setters, execute} = await func (
73
78
$__export ,
74
79
$__moduleContext
75
80
) ;
@@ -79,7 +84,7 @@ class System {
79
84
for ( let i = 0 ; i < resolvedDeps . length ; i ++ ) {
80
85
setters [ i ] ( resolvedDeps [ i ] ) ;
81
86
}
82
- resolve ( { setters, execute, exports } ) ;
87
+ resolve ( { setters, execute, exports} ) ;
83
88
} catch ( e ) {
84
89
console . log ( e ) ;
85
90
throw e ;
@@ -91,6 +96,10 @@ class System {
91
96
}
92
97
93
98
async executeDeps ( ...ids ) {
99
+ if ( ! Array . isArray ( ids ) ) {
100
+ debugger ;
101
+ throw new Error ( 'Expected array of ids, got: ' + ids ) ;
102
+ }
94
103
return Promise . all (
95
104
ids . map ( async ( id ) => {
96
105
id = this . normalize ( id ) ;
@@ -103,7 +112,7 @@ class System {
103
112
return ( this . executedDeps [ id ] = new Promise ( async ( resolve , reject ) => {
104
113
const [ deps ] = await this . getModule ( id ) ;
105
114
const executedDeps = await this . executeDeps ( ...deps ) ;
106
- const { execute, exports, setters } = await this . resolvedExports [ id ] ;
115
+ const { execute, exports, setters} = await this . resolvedExports [ id ] ;
107
116
for ( let i = 0 ; i < executedDeps . length ; i ++ ) {
108
117
setters [ i ] ( executedDeps [ i ] ) ;
109
118
}
0 commit comments