File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export function resolveAsyncComponents (matched: Array<RouteRecord>): Function {
20
20
pending ++
21
21
22
22
const resolve = once ( resolvedDef => {
23
- if ( resolvedDef . __esModule && resolvedDef . default ) {
23
+ if ( isESModule ( resolvedDef ) ) {
24
24
resolvedDef = resolvedDef . default
25
25
}
26
26
// save resolved on async factory in case it's used elsewhere
@@ -86,6 +86,14 @@ export function flatten (arr: Array<any>): Array<any> {
86
86
return Array . prototype . concat . apply ( [ ] , arr )
87
87
}
88
88
89
+ const hasSymbol =
90
+ typeof Symbol === 'function' &&
91
+ typeof Symbol . toStringTag === 'symbol'
92
+
93
+ function isESModule ( obj ) {
94
+ return obj . __esModule || ( hasSymbol && obj [ Symbol . toStringTag ] === 'Module' )
95
+ }
96
+
89
97
// in Webpack 2, require.ensure now also returns a Promise
90
98
// so the resolve/reject functions may get called an extra time
91
99
// if the user uses an arrow function shorthand that happens to
You can’t perform that action at this time.
0 commit comments