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 {
6060 this . runtimeOptions . linkType
6161 ? `linkTag.type = ${ JSON . stringify ( this . runtimeOptions . linkType ) } ;`
6262 : '' ,
63- 'var onLinkComplete = function (event) {' ,
64- Template . indent ( [
63+ `var onLinkComplete = ${ runtimeTemplate . basicFunction ( 'event' , [
6564 '// avoid mem leaks.' ,
6665 'linkTag.onerror = linkTag.onload = null;' ,
6766 "if (event.type === 'load') {" ,
@@ -76,8 +75,7 @@ module.exports = class CssLoadingRuntimeModule extends RuntimeModule {
7675 'reject(err);' ,
7776 ] ) ,
7877 '}' ,
79- ] ) ,
80- '};' ,
78+ ] ) } `,
8179 'linkTag.onerror = linkTag.onload = onLinkComplete;' ,
8280 'linkTag.href = fullhref;' ,
8381 crossOriginLoading
Original file line number Diff line number Diff line change @@ -827,7 +827,7 @@ module.exports = function (urlString) {
827827/******/
828828/******/ linkTag . rel = "stylesheet" ;
829829/******/ linkTag . type = "text/css" ;
830- /******/ var onLinkComplete = function ( event ) {
830+ /******/ var onLinkComplete = ( event ) => {
831831/******/ // avoid mem leaks.
832832/******/ linkTag . onerror = linkTag . onload = null ;
833833/******/ if ( event . type === 'load' ) {
@@ -840,7 +840,7 @@ module.exports = function (urlString) {
840840/******/ linkTag . parentNode . removeChild ( linkTag )
841841/******/ reject ( err ) ;
842842/******/ }
843- /******/ } ;
843+ /******/ }
844844/******/ linkTag . onerror = linkTag . onload = onLinkComplete ;
845845/******/ linkTag . href = fullhref ;
846846/******/
Original file line number Diff line number Diff line change 162162/******/
163163/******/ linkTag . rel = "stylesheet" ;
164164/******/ linkTag . type = "text/css" ;
165- /******/ var onLinkComplete = function ( event ) {
165+ /******/ var onLinkComplete = ( event ) => {
166166/******/ // avoid mem leaks.
167167/******/ linkTag . onerror = linkTag . onload = null ;
168168/******/ if ( event . type === 'load' ) {
175175/******/ linkTag . parentNode . removeChild ( linkTag )
176176/******/ reject ( err ) ;
177177/******/ }
178- /******/ } ;
178+ /******/ }
179179/******/ linkTag . onerror = linkTag . onload = onLinkComplete ;
180180/******/ linkTag . href = fullhref ;
181181/******/
Original file line number Diff line number Diff line change 162162/******/
163163/******/ linkTag . rel = "stylesheet" ;
164164/******/ linkTag . type = "text/css" ;
165- /******/ var onLinkComplete = function ( event ) {
165+ /******/ var onLinkComplete = ( event ) => {
166166/******/ // avoid mem leaks.
167167/******/ linkTag . onerror = linkTag . onload = null ;
168168/******/ if ( event . type === 'load' ) {
175175/******/ linkTag . parentNode . removeChild ( linkTag )
176176/******/ reject ( err ) ;
177177/******/ }
178- /******/ } ;
178+ /******/ }
179179/******/ linkTag . onerror = linkTag . onload = onLinkComplete ;
180180/******/ linkTag . href = fullhref ;
181181/******/
Original file line number Diff line number Diff line change 162162/******/
163163/******/ linkTag . rel = "stylesheet" ;
164164/******/ linkTag . type = "text/css" ;
165- /******/ var onLinkComplete = function ( event ) {
165+ /******/ var onLinkComplete = ( event ) => {
166166/******/ // avoid mem leaks.
167167/******/ linkTag . onerror = linkTag . onload = null ;
168168/******/ if ( event . type === 'load' ) {
175175/******/ linkTag . parentNode . removeChild ( linkTag )
176176/******/ reject ( err ) ;
177177/******/ }
178- /******/ } ;
178+ /******/ }
179179/******/ linkTag . onerror = linkTag . onload = onLinkComplete ;
180180/******/ linkTag . href = fullhref ;
181181/******/
You can’t perform that action at this time.
0 commit comments