@@ -177,12 +177,14 @@ var hotInitCode = function() {
177177
178178 function hotUpdateDownloaded ( ) {
179179 var outdatedDependencies = hotUpdateOutdatedDependencies = { } ;
180- var outdatedModules = hotUpdateOutdatedModules = Object . keys ( hotUpdate ) . slice ( ) ;
180+ var outdatedModules = hotUpdateOutdatedModules = Object . keys ( hotUpdate ) . map ( function ( id ) {
181+ return + id ;
182+ } ) ;
181183 var queue = outdatedModules . slice ( ) ;
182184 while ( queue . length > 0 ) {
183185 var moduleId = queue . pop ( ) ;
184186 var module = installedModules [ moduleId ] ;
185- if ( module . hot . _selfAccepted )
187+ if ( ! module || module . hot . _selfAccepted )
186188 continue ;
187189 if ( module . hot . _selfDeclined ) {
188190 hotSetStatus ( "abort" ) ;
@@ -322,8 +324,9 @@ var hotInitCode = function() {
322324 var hotWaitingFilesMap = { } ;
323325 var hotCallback ;
324326 function hotCheck ( callback ) {
327+ callback = callback || function ( err ) { if ( err ) throw err } ;
325328 if ( hotStatus !== "idle" ) throw new Error ( "check() is only allowed in idle status" ) ;
326- if ( typeof XMLHttpRequest === "undefined" || ! Array . prototype . forEach || ! Object . keys )
329+ if ( typeof XMLHttpRequest === "undefined" || ! Array . prototype . forEach || ! Array . prototype . map || ! Object . keys )
327330 return callback ( new Error ( "No browser support" ) ) ;
328331 hotSetStatus ( "check" ) ;
329332
@@ -346,7 +349,7 @@ var hotInitCode = function() {
346349
347350 hotWaitingFilesMap = { } ;
348351 hotSetStatus ( "prepare" ) ;
349- hotCallback = callback || function ( err ) { if ( err ) throw err } ;
352+ hotCallback = callback ;
350353 hotUpdate = { } ;
351354 var hash = hotCurrentHash ;
352355 /*foreachInstalledChunks*/ {
@@ -373,22 +376,23 @@ var hotInitCode = function() {
373376 var outdatedModules = hotUpdateOutdatedModules ;
374377 var outdatedDependencies = hotUpdateOutdatedDependencies ;
375378 var outdatedSelfAcceptedModules = outdatedModules . filter ( function ( moduleId ) {
376- return installedModules [ moduleId ] . hot . _selfAccepted ;
379+ return installedModules [ moduleId ] && installedModules [ moduleId ] . hot . _selfAccepted ;
377380 } ) ;
378381
379382 hotSetStatus ( "dispose" ) ;
380383 var oldModulesData = { } ;
381384 outdatedModules . forEach ( function ( moduleId ) {
382385 var data = { } ;
383386 var module = installedModules [ moduleId ] ;
387+ if ( ! module ) return ;
384388 module . hot . _disposeHandlers . forEach ( function ( cb ) {
385389 cb ( data ) ;
386390 } ) ;
387391 oldModulesData [ moduleId ] = data ;
388- return
389392 } , this ) ;
390393 outdatedModules . forEach ( function ( moduleId ) {
391394 var module = installedModules [ moduleId ] ;
395+ if ( ! module ) return ;
392396 delete installedModules [ moduleId ] ;
393397 module . children . forEach ( function ( child ) {
394398 child = installedModules [ child ] ;
0 commit comments