Skip to content

Commit 8d5ed06

Browse files
authored
Merge pull request webpack#4607 from jun0205/webpack-1
IE8 for-in, skip prototype property.
2 parents f66f024 + ee72bce commit 8d5ed06

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/JsonpMainTemplatePlugin.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ JsonpMainTemplatePlugin.prototype.apply = function(mainTemplate) {
105105
]),
106106
"}",
107107
"for(moduleId in moreModules) {",
108-
this.indent(this.renderAddModule(hash, chunk, "moduleId", "moreModules[moduleId]")),
108+
this.indent([
109+
"if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {",
110+
this.indent(this.renderAddModule(hash, chunk, "moduleId", "moreModules[moduleId]")),
111+
"}"
112+
]),
109113
"}",
110114
"if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules);",
111115
"while(callbacks.length)",

0 commit comments

Comments
 (0)