use hasOwnProperty in for in loops

#450
This commit is contained in:
Tobias Koppers 2014-09-15 10:35:56 +02:00
parent 2eed5961b0
commit 1a10838a61
1 changed files with 27 additions and 21 deletions

View File

@ -367,8 +367,10 @@ var hotInitCode = Template.getFunctionContent(function() {
return;
hotRequestedFilesMap[chunkId] = false;
for(var moduleId in moreModules) {
if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
hotUpdate[moduleId] = moreModules[moduleId];
}
}
if(--hotWaitingFiles === 0 && hotChunksLoading === 0) {
hotUpdateDownloaded();
}
@ -394,8 +396,10 @@ var hotInitCode = Template.getFunctionContent(function() {
} else {
var outdatedModules = [];
for(var id in hotUpdate) {
if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) {
outdatedModules.push(+id);
}
}
callback(null, outdatedModules);
}
}
@ -463,6 +467,7 @@ var hotInitCode = Template.getFunctionContent(function() {
var outdatedModules = [];
var appliedUpdate = {};
for(var id in hotUpdate) {
if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) {
var moduleId = +id;
var result = getAffectedStuff(moduleId);
if(!result) {
@ -485,6 +490,7 @@ var hotInitCode = Template.getFunctionContent(function() {
}
}
}
}
// Store self accepted outdated modules to require them later by the module system
var outdatedSelfAcceptedModules = [];