code: function(l){
          if(l.layersContext){
              for (var i = 0, len = l.layersContext.length; i < len; i++) {
                  var layerContext = l.layersContext[i];
                  var nPath = [];
                  var nTitle = l.title || "";
                  if(l.metadata && l.metadata.nestingPath){
                      nPath = l.metadata.nestingPath.slice();
                  }
                  if (nTitle != "") {
                      nPath.push(nTitle);
                  }
                  layerContext.metadata.nestingPath = nPath;
                  if(layerContext.layersContext){
                      this.setNestingPath(layerContext);
                  }
              }
          }
      }
docs: Method: setNestingPath
  Set the nestingPath property of the layer depending on the position
  of the layer in hierarchy of layers.
  
  Parameters:
  l - {Object} An object that may have a layersContext array property.