diff --git a/main/webapp/modules/core/MOD-INF/controller.js b/main/webapp/modules/core/MOD-INF/controller.js index a5642a551..85da832d9 100644 --- a/main/webapp/modules/core/MOD-INF/controller.js +++ b/main/webapp/modules/core/MOD-INF/controller.js @@ -592,7 +592,11 @@ function process(path, request, response) { var output = response.getWriter(); try { var paths = ClientSideResourceManager.getPaths(lastSegment + "/scripts"); - for each (var qualifiedPath in paths) { + for (var key in paths) { + if (!paths.hasOwnProperty(key)) { + continue; + } + var qualifiedPath = paths[key]; var input = null; try { var url = qualifiedPath.module.getResource(qualifiedPath.path); @@ -637,9 +641,12 @@ function process(path, request, response) { var styles = ClientSideResourceManager.getPaths(lastSegment + "/styles"); var styleInjection = []; - for each (var qualifiedPath in styles) { - styleInjection.push( - ''); + for (var key in styles) { + if (styles.hasOwnProperty(key)) { + var qualifiedPath = styles[key]; + styleInjection.push( + ''); + } } context.styleInjection = styleInjection.join("\n"); @@ -648,9 +655,12 @@ function process(path, request, response) { } else { var scripts = ClientSideResourceManager.getPaths(lastSegment + "/scripts"); var scriptInjection = []; - for each (var qualifiedPath in scripts) { - scriptInjection.push( - ''); + for (var key in scripts) { + if (scripts.hasOwnProperty(key)) { + var qualifiedPath = scripts[key]; + scriptInjection.push( + ''); + } } context.scriptInjection = scriptInjection.join("\n"); } @@ -659,11 +669,19 @@ function process(path, request, response) { var encodings = []; var sortedCharsetMap = Packages.java.nio.charset.Charset.availableCharsets(); - for each (var code in sortedCharsetMap.keySet().toArray()) { + var keySetArray = sortedCharsetMap.keySet().toArray(); + for (var key in keySetArray) { + if (!keySetArray.hasOwnProperty(key)) { + continue; + } + var code = keySetArray[key]; var charset = sortedCharsetMap.get(code); + var aliasesArray = charset.aliases().toArray(); var aliases = []; - for each (var alias in charset.aliases().toArray()) { - aliases.push(alias); + for (var key1 in aliasesArray) { + if (aliasesArray.hasOwnProperty(key1)) { + aliases.push(aliasesArray[key1]); + } } encodings.push({