code: function getBackingStoreAncestor (layer) {
    while (layer) {
      if (layer.backingStoreId) {
        return layer;
      }
      layer = layer.parentLayer;
    }
    return null;
  }
docs: Find the nearest backing store ancestor for a given layer.
  
  @param {RenderLayer} layer