use slice to clone arguments as an array, because arguments does not support splice
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 3 Sep 2010 17:35:00 +0000 (17:35 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 3 Sep 2010 17:35:00 +0000 (17:35 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17477 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/MARC/Record.js

index 5c9fb9d..163dc32 100644 (file)
@@ -83,12 +83,13 @@ if(!dojo._hasResource["MARC.Record"]) {
         },
 
         insertFieldsBefore : function (target) {
-            arguments.splice(0,1);
+            var args = Array.prototype.slice.call(arguments);
+            args.splice(0,1);
             var me = this;
             for (var j = 0; j < this.fields.length; j++) {
                 if (target === this.fields[j]) {
                     j--;
-                    dojo.forEach( arguments, function (f) {
+                    dojo.forEach( args, function (f) {
                         me.fields.splice(j++,0,f);
                     });
                     break;
@@ -97,11 +98,12 @@ if(!dojo._hasResource["MARC.Record"]) {
         },
 
         insertFieldsAfter : function (target) {
-            arguments.splice(0,1);
+            var args = Array.prototype.slice.call(arguments);
+            args.splice(0,1);
             var me = this;
             for (var j = 0; j < this.fields.length; j++) {
                 if (target === this.fields[j]) {
-                    dojo.forEach( arguments, function (f) {
+                    dojo.forEach( args, function (f) {
                         me.fields.splice(j++,0,f);
                     });
                     break;