mirror of https://github.com/webpack/webpack.git
parent
2eed5961b0
commit
1a10838a61
|
|
@ -367,7 +367,9 @@ var hotInitCode = Template.getFunctionContent(function() {
|
|||
return;
|
||||
hotRequestedFilesMap[chunkId] = false;
|
||||
for(var moduleId in moreModules) {
|
||||
hotUpdate[moduleId] = moreModules[moduleId];
|
||||
if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
|
||||
hotUpdate[moduleId] = moreModules[moduleId];
|
||||
}
|
||||
}
|
||||
if(--hotWaitingFiles === 0 && hotChunksLoading === 0) {
|
||||
hotUpdateDownloaded();
|
||||
|
|
@ -394,7 +396,9 @@ var hotInitCode = Template.getFunctionContent(function() {
|
|||
} else {
|
||||
var outdatedModules = [];
|
||||
for(var id in hotUpdate) {
|
||||
outdatedModules.push(+id);
|
||||
if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) {
|
||||
outdatedModules.push(+id);
|
||||
}
|
||||
}
|
||||
callback(null, outdatedModules);
|
||||
}
|
||||
|
|
@ -463,25 +467,27 @@ var hotInitCode = Template.getFunctionContent(function() {
|
|||
var outdatedModules = [];
|
||||
var appliedUpdate = {};
|
||||
for(var id in hotUpdate) {
|
||||
var moduleId = +id;
|
||||
var result = getAffectedStuff(moduleId);
|
||||
if(!result) {
|
||||
if(options.ignoreUnaccepted)
|
||||
continue;
|
||||
hotSetStatus("abort");
|
||||
return callback(new Error("Aborted because " + moduleId + " is not accepted"));
|
||||
}
|
||||
if(result instanceof Error) {
|
||||
hotSetStatus("abort");
|
||||
return callback(result);
|
||||
}
|
||||
appliedUpdate[moduleId] = hotUpdate[moduleId];
|
||||
addAllToSet(outdatedModules, result[0]);
|
||||
for(var moduleId in result[1]) {
|
||||
if(Object.prototype.hasOwnProperty.call(result[1], moduleId)) {
|
||||
if(!outdatedDependencies[moduleId])
|
||||
outdatedDependencies[moduleId] = [];
|
||||
addAllToSet(outdatedDependencies[moduleId], result[1][moduleId]);
|
||||
if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) {
|
||||
var moduleId = +id;
|
||||
var result = getAffectedStuff(moduleId);
|
||||
if(!result) {
|
||||
if(options.ignoreUnaccepted)
|
||||
continue;
|
||||
hotSetStatus("abort");
|
||||
return callback(new Error("Aborted because " + moduleId + " is not accepted"));
|
||||
}
|
||||
if(result instanceof Error) {
|
||||
hotSetStatus("abort");
|
||||
return callback(result);
|
||||
}
|
||||
appliedUpdate[moduleId] = hotUpdate[moduleId];
|
||||
addAllToSet(outdatedModules, result[0]);
|
||||
for(var moduleId in result[1]) {
|
||||
if(Object.prototype.hasOwnProperty.call(result[1], moduleId)) {
|
||||
if(!outdatedDependencies[moduleId])
|
||||
outdatedDependencies[moduleId] = [];
|
||||
addAllToSet(outdatedDependencies[moduleId], result[1][moduleId]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue