[open-ils-commits] r15514 - trunk/Open-ILS/web/js/dojo/MARC (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Feb 12 11:06:22 EST 2010
Author: miker
Date: 2010-02-12 11:06:19 -0500 (Fri, 12 Feb 2010)
New Revision: 15514
Modified:
trunk/Open-ILS/web/js/dojo/MARC/Record.js
Log:
Addressing https://bugs.launchpad.net/evergreen/+bug/520632 -- not strictly required here, but for(;;) is better form for array access
Modified: trunk/Open-ILS/web/js/dojo/MARC/Record.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/MARC/Record.js 2010-02-12 16:04:33 UTC (rev 15513)
+++ trunk/Open-ILS/web/js/dojo/MARC/Record.js 2010-02-12 16:06:19 UTC (rev 15514)
@@ -68,10 +68,10 @@
insertOrderedFields : function () {
var me = this;
- for ( var i in arguments ) {
+ for ( var i in arguments ) { // arguments is special, and for..in is correct
var f = arguments[i];
var done = false;
- for (var j in this.fields) {
+ for (var j = 0; j < this.fields.length; j++) {
if (f.tag > this.fields[j].tag) {
this.insertFieldsBefore(this.fields[j], f);
done = true;
@@ -85,7 +85,7 @@
insertFieldsBefore : function (target) {
arguments.splice(0,1);
var me = this;
- for (var j in this.fields) {
+ for (var j = 0; j < this.fields.length; j++) {
if (target === this.fields[j]) {
j--;
dojo.forEach( arguments, function (f) {
@@ -99,7 +99,7 @@
insertFieldsAfter : function (target) {
arguments.splice(0,1);
var me = this;
- for (var j in this.fields) {
+ for (var j = 0; j < this.fields.length; j++) {
if (target === this.fields[j]) {
dojo.forEach( arguments, function (f) {
me.fields.splice(j++,0,f);
@@ -114,7 +114,7 @@
var counter = 0;
for ( var i in arguments ) {
var f = arguments[i];
- for (var j in me.fields) {
+ for (var j = 0; j < me.fields.length; j++) {
if (f === me.fields[j]) {
me.fields[j].record = null;
me.fields.splice(j,0);
More information about the open-ils-commits
mailing list