src/basis/tracker.js
function isPathMatchSelector(path, selector){
  function isMatch(path, selector){
    path = typeof path == 'string' ? parseRole(path) : path || '';
    selector = typeof selector == 'string' ? parseRole(selector) : selector || '';

    return selector.role == path.role &&
           (selector.roleId == '*' || selector.roleId == path.roleId) &&
           selector.subrole == path.subrole;
  }

  var pathIndex = path.length;
  var selectorIndex = selector.length;

  if (!selectorIndex)
    return true;

  if (!isMatch(path[--pathIndex], selector[--selectorIndex]))
    return false;

  while (pathIndex > 0 && selectorIndex > 0)
    if (!isMatch(path[--pathIndex], selector[--selectorIndex]))
      selectorIndex++;

  return selectorIndex === 0;
}
function isPathMatchSelector(path, selector){
  function isMatch(path, selector){
    path = typeof path == 'string' ? parseRole(path) : path || '';
    selector = typeof selector == 'string' ? parseRole(selector) : selector || '';

    return selector.role == path.role &&
           (selector.roleId == '*' || selector.roleId == path.roleId) &&
           selector.subrole == path.subrole;
  }

  var pathIndex = path.length;
  var selectorIndex = selector.length;

  if (!selectorIndex)
    return true;

  if (!isMatch(path[--pathIndex], selector[--selectorIndex]))
    return false;

  while (pathIndex > 0 && selectorIndex > 0)
    if (!isMatch(path[--pathIndex], selector[--selectorIndex]))
      selectorIndex++;

  return selectorIndex === 0;
}
function isPathMatchSelector ( path , selector ) { function isMatch ( path , selector ) { path = typeof path == 'string' ? parseRole ( path ) : path || '' ; selector = typeof selector == 'string' ? parseRole ( selector ) : selector || '' ; return selector . role == path . role && ( selector . roleId == '*' || selector . roleId == path . roleId ) && selector . subrole == path . subrole ; } var pathIndex = path . length ; var selectorIndex = selector . length ; if ( ! selectorIndex ) return true ; if ( ! isMatch ( path [ -- pathIndex ] , selector [ -- selectorIndex ] ) ) return false ; while ( pathIndex > 0 && selectorIndex > 0 ) if ( ! isMatch ( path [ -- pathIndex ] , selector [ -- selectorIndex ] ) ) selectorIndex ++ ; return selectorIndex === 0 ; }
private except for tests
@param {Array.<RoleObject>} path
@param {string|RoleObject} selector
@return {boolean}
private except for tests