mirror of
https://github.com/Esri/offline-editor-js.git
synced 2025-12-15 15:20:05 +00:00
safe use of for...in to iterate over object keys
This commit is contained in:
parent
ac19b9704c
commit
050934642f
@ -193,6 +193,9 @@ define([
|
||||
//
|
||||
for(var layerUrl in optimizedEdits)
|
||||
{
|
||||
if(!optimizedEdits.hasOwnProperty(layerUrl))
|
||||
continue;
|
||||
|
||||
var layer = this._featureLayers[ layerUrl ];
|
||||
var layerEdits = optimizedEdits[layerUrl];
|
||||
|
||||
@ -204,6 +207,9 @@ define([
|
||||
var adds = [], updates = [], deletes = [];
|
||||
for(var objectId in layerEdits)
|
||||
{
|
||||
if(!layerEdits.hasOwnProperty(objectId))
|
||||
continue;
|
||||
|
||||
var edit = layerEdits[objectId];
|
||||
switch(edit.operation)
|
||||
{
|
||||
|
||||
@ -597,7 +597,7 @@ describe("Offline Editing", function()
|
||||
});
|
||||
});
|
||||
|
||||
async.it("Go Online", function(done)
|
||||
async.it("go Online", function(done)
|
||||
{
|
||||
expect(getObjectIds(g_featureLayers[0].graphics)).toEqual(getObjectIds([g1,g2,g4,g6]));
|
||||
expect(getObjectIds(g_featureLayers[1].graphics)).toEqual(getObjectIds([l1,l2,l3]));
|
||||
@ -612,6 +612,9 @@ describe("Offline Editing", function()
|
||||
expect(Object.keys(responses).length).toBe(2);
|
||||
for(var layerUrl in responses)
|
||||
{
|
||||
if( !responses.hasOwnProperty(layerUrl))
|
||||
continue;
|
||||
|
||||
var layerResponses = responses[layerUrl];
|
||||
var layerId = layerUrl.substring(layerUrl.lastIndexOf('/')+1);
|
||||
console.log(layerId, layerResponses);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user