diff --git a/lib/OpenLayers/Format/GML.js b/lib/OpenLayers/Format/GML.js index 47b4f64638..4a72044dc3 100644 --- a/lib/OpenLayers/Format/GML.js +++ b/lib/OpenLayers/Format/GML.js @@ -333,7 +333,7 @@ OpenLayers.Format.GML = OpenLayers.Class(OpenLayers.Format, { while (nums[nums.length-1] == "") nums.pop(); - for(i = 0; i < nums.length; i = i + this.dim) { + for(var i = 0; i < nums.length; i = i + this.dim) { x = parseFloat(nums[i]); y = parseFloat(nums[i+1]); p.points.push(new OpenLayers.Geometry.Point(x, y)); diff --git a/lib/OpenLayers/Layer/WFS.js b/lib/OpenLayers/Layer/WFS.js index 5f3d526e73..265a29a945 100644 --- a/lib/OpenLayers/Layer/WFS.js +++ b/lib/OpenLayers/Layer/WFS.js @@ -342,7 +342,7 @@ OpenLayers.Layer.WFS = OpenLayers.Class( this.commitReport('WFS Transaction: SUCCESS', response); for(var i = 0; i < this.features.length; i++) { - i.state = null; + this.features[i].state = null; } // TBD redraw the layer or reset the state of features // foreach features: set state to null diff --git a/tests/Format/test_GML.html b/tests/Format/test_GML.html index 2d08ee7cc2..eba312def1 100644 --- a/tests/Format/test_GML.html +++ b/tests/Format/test_GML.html @@ -49,6 +49,13 @@ t.eq(data[0].fid, '221', 'fid on polygons set correctly (with whitespace)'); t.eq(data[1].fid, '8', 'fid on linestrings set correctly with whitespace'); } + function test_Format_GML_no_clobber(t) { + t.plan(1); + var parser = new OpenLayers.Format.GML(); + data = parser.read(test_content); + t.eq(window.i, undefined, + "i is undefined in window scope after reading."); + } // -->