replace deprecated "for each...in" syntax
@@ -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,10 +641,13 @@ function process(path, request, response) {
var styles = ClientSideResourceManager.getPaths(lastSegment + "/styles");
var styleInjection = [];
- for each (var qualifiedPath in styles) {
+ for (var key in styles) {
+ if (styles.hasOwnProperty(key)) {
+ var qualifiedPath = styles[key];
styleInjection.push(
'<link type="text/css" rel="stylesheet" href="' + qualifiedPath.fullPath.substring(1) + '" />');
}
+ }
context.styleInjection = styleInjection.join("\n");
if (bundle) {
@@ -648,10 +655,13 @@ function process(path, request, response) {
} else {
var scripts = ClientSideResourceManager.getPaths(lastSegment + "/scripts");
var scriptInjection = [];
- for each (var qualifiedPath in scripts) {
+ for (var key in scripts) {
+ if (scripts.hasOwnProperty(key)) {
+ var qualifiedPath = scripts[key];
scriptInjection.push(
'<script type="text/javascript" src="' + qualifiedPath.fullPath.substring(1) + '"></script>');
}
+ }
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({
