File tree Expand file tree Collapse file tree 5 files changed +10
-12
lines changed
insert-function/expected/webpack-5
insert-string/expected/webpack-5
insert-undefined/expected/webpack-5 Expand file tree Collapse file tree 5 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,7 @@ module.exports = class CssLoadingRuntimeModule extends RuntimeModule {
60
60
this . runtimeOptions . linkType
61
61
? `linkTag.type = ${ JSON . stringify ( this . runtimeOptions . linkType ) } ;`
62
62
: '' ,
63
- 'var onLinkComplete = function (event) {' ,
64
- Template . indent ( [
63
+ `var onLinkComplete = ${ runtimeTemplate . basicFunction ( 'event' , [
65
64
'// avoid mem leaks.' ,
66
65
'linkTag.onerror = linkTag.onload = null;' ,
67
66
"if (event.type === 'load') {" ,
@@ -76,8 +75,7 @@ module.exports = class CssLoadingRuntimeModule extends RuntimeModule {
76
75
'reject(err);' ,
77
76
] ) ,
78
77
'}' ,
79
- ] ) ,
80
- '};' ,
78
+ ] ) } `,
81
79
'linkTag.onerror = linkTag.onload = onLinkComplete;' ,
82
80
'linkTag.href = fullhref;' ,
83
81
crossOriginLoading
Original file line number Diff line number Diff line change @@ -827,7 +827,7 @@ module.exports = function (urlString) {
827
827
/******/
828
828
/******/ linkTag . rel = "stylesheet" ;
829
829
/******/ linkTag . type = "text/css" ;
830
- /******/ var onLinkComplete = function ( event ) {
830
+ /******/ var onLinkComplete = ( event ) => {
831
831
/******/ // avoid mem leaks.
832
832
/******/ linkTag . onerror = linkTag . onload = null ;
833
833
/******/ if ( event . type === 'load' ) {
@@ -840,7 +840,7 @@ module.exports = function (urlString) {
840
840
/******/ linkTag . parentNode . removeChild ( linkTag )
841
841
/******/ reject ( err ) ;
842
842
/******/ }
843
- /******/ } ;
843
+ /******/ }
844
844
/******/ linkTag . onerror = linkTag . onload = onLinkComplete ;
845
845
/******/ linkTag . href = fullhref ;
846
846
/******/
Original file line number Diff line number Diff line change 162
162
/******/
163
163
/******/ linkTag . rel = "stylesheet" ;
164
164
/******/ linkTag . type = "text/css" ;
165
- /******/ var onLinkComplete = function ( event ) {
165
+ /******/ var onLinkComplete = ( event ) => {
166
166
/******/ // avoid mem leaks.
167
167
/******/ linkTag . onerror = linkTag . onload = null ;
168
168
/******/ if ( event . type === 'load' ) {
175
175
/******/ linkTag . parentNode . removeChild ( linkTag )
176
176
/******/ reject ( err ) ;
177
177
/******/ }
178
- /******/ } ;
178
+ /******/ }
179
179
/******/ linkTag . onerror = linkTag . onload = onLinkComplete ;
180
180
/******/ linkTag . href = fullhref ;
181
181
/******/
Original file line number Diff line number Diff line change 162
162
/******/
163
163
/******/ linkTag . rel = "stylesheet" ;
164
164
/******/ linkTag . type = "text/css" ;
165
- /******/ var onLinkComplete = function ( event ) {
165
+ /******/ var onLinkComplete = ( event ) => {
166
166
/******/ // avoid mem leaks.
167
167
/******/ linkTag . onerror = linkTag . onload = null ;
168
168
/******/ if ( event . type === 'load' ) {
175
175
/******/ linkTag . parentNode . removeChild ( linkTag )
176
176
/******/ reject ( err ) ;
177
177
/******/ }
178
- /******/ } ;
178
+ /******/ }
179
179
/******/ linkTag . onerror = linkTag . onload = onLinkComplete ;
180
180
/******/ linkTag . href = fullhref ;
181
181
/******/
Original file line number Diff line number Diff line change 162
162
/******/
163
163
/******/ linkTag . rel = "stylesheet" ;
164
164
/******/ linkTag . type = "text/css" ;
165
- /******/ var onLinkComplete = function ( event ) {
165
+ /******/ var onLinkComplete = ( event ) => {
166
166
/******/ // avoid mem leaks.
167
167
/******/ linkTag . onerror = linkTag . onload = null ;
168
168
/******/ if ( event . type === 'load' ) {
175
175
/******/ linkTag . parentNode . removeChild ( linkTag )
176
176
/******/ reject ( err ) ;
177
177
/******/ }
178
- /******/ } ;
178
+ /******/ }
179
179
/******/ linkTag . onerror = linkTag . onload = onLinkComplete ;
180
180
/******/ linkTag . href = fullhref ;
181
181
/******/
You can’t perform that action at this time.
0 commit comments