Skip to content

Commit

Permalink
Merge pull request jsonform#90 from Coridyn/fix-array-ie8
Browse files Browse the repository at this point in the history
Fix IE8 array value retrieval
  • Loading branch information
tidoust committed Oct 28, 2013
2 parents 0a4fb58 + 57b8f25 commit b4f8050
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/jsonform.js
Original file line number Diff line number Diff line change
Expand Up @@ -1356,6 +1356,7 @@ jsonform.util.getObjKey = function (obj, key, ignoreArrays) {
if ((innerobj === null) || (typeof innerobj !== "object")) return null;
subkey = keyparts[i];
prop = subkey.replace(reArray, '');
reArray.lastIndex = 0;
arrayMatch = reArray.exec(subkey);
if (arrayMatch) {
while (true) {
Expand Down Expand Up @@ -1410,6 +1411,7 @@ jsonform.util.setObjKey = function(obj,key,value) {
for (var i = 0; i < keyparts.length-1; i++) {
subkey = keyparts[i];
prop = subkey.replace(reArray, '');
reArray.lastIndex = 0;
arrayMatch = reArray.exec(subkey);
if (arrayMatch) {
// Subkey is part of an array
Expand Down Expand Up @@ -1441,6 +1443,7 @@ jsonform.util.setObjKey = function(obj,key,value) {
// Set the final value
subkey = keyparts[keyparts.length - 1];
prop = subkey.replace(reArray, '');
reArray.lastIndex = 0;
arrayMatch = reArray.exec(subkey);
if (arrayMatch) {
while (true) {
Expand Down

0 comments on commit b4f8050

Please sign in to comment.