Revert "bug 964: Reduce variable scope where possible" bug-964
authorBenny Baumann <BenBE@geshi.org>
Tue, 19 Feb 2013 23:14:47 +0000 (00:14 +0100)
committerBenny Baumann <BenBE@geshi.org>
Tue, 19 Feb 2013 23:14:47 +0000 (00:14 +0100)
This reverts commit 387fde16ca52b6ccfc5a46be99219cd09a7411ce.
Decision based on discussion with Michael Tänzer.

www/keygenIE.js

index 50faf76..be2d184 100644 (file)
@@ -167,6 +167,8 @@ var CAcert_keygen_IE = function () {
 
                /// Fill the algorithm list
                var getAlgorithmList = function () {
+                       var i;
+                       
                        if (!providerList) {
                                return false;
                        }
@@ -182,7 +184,7 @@ var CAcert_keygen_IE = function () {
                                );
 
                        removeChildren(algorithm);
-                       for (var i = 0; i < cspStats.Count; i++) {
+                       for (i = 0; i < cspStats.Count; i++) {
                                var alg = cspStats.ItemByIndex(i).CspAlgorithm;
                                algorithm.appendChild(option(alg.Name, i));
                        }
@@ -192,6 +194,8 @@ var CAcert_keygen_IE = function () {
 
                /// Fill the crypto provider list
                var getProviderList = function () {
+                       var i;
+                       
                        var csps = factory.CreateObject("X509Enrollment.CCspInformations");
 
                        // Get provider information
@@ -199,7 +203,7 @@ var CAcert_keygen_IE = function () {
 
                        removeChildren(provider);
 
-                       for (var i = 0; i < csps.Count; i++) {
+                       for (i = 0; i < csps.Count; i++) {
                                var csp = csps.ItemByIndex(i);
                                provider.appendChild(option(csp.Name, i));
                        }
@@ -473,12 +477,14 @@ var CAcert_keygen_IE = function () {
 
                /// Fill the algorithm selection box
                var getAlgorithmList = function () {
+                       var i, j;
+                       
                        refreshProvider();
 
                        removeChildren(algorithm);
 
-                       for (var i = 0; i < algClasses.length; ++i) {
-                               for (var j = 0; true; ++j) {
+                       for (i = 0; i < algClasses.length; ++i) {
+                               for (j = 0; true; ++j) {
                                        try {
                                                var algId = cenroll.EnumAlgs(j, algClasses[i]);
                                                var algName = cenroll.GetAlgName(algId);
@@ -494,13 +500,15 @@ var CAcert_keygen_IE = function () {
 
                /// Fill the provider selection box
                var getProviderList = function () {
+                       var i, j;
+                       
                        removeChildren(provider);
 
-                       for (var i = 0; i < providerTypes.length; ++i) {
+                       for (i = 0; i < providerTypes.length; ++i) {
                                cenroll.providerType = providerTypes[i];
 
                                var providerName = "invalid";
-                               for (var j = 0; true; ++j) {
+                               for (j = 0; true; ++j) {
                                        try {
                                                providerName = cenroll.enumProviders(j, 0);
                                                provider.appendChild(option(providerName, providerTypes[i]));