code: function findAttrIndexInNode(name, attrs) {
      if (attrs === null)
          return -1;
      var selectOnlyMode = false;
      var i = 0;
      while (i < attrs.length) {
          var maybeAttrName = attrs[i];
          if (maybeAttrName === name) {
              return i;
          }
          else if (maybeAttrName === 0 /* NamespaceURI */) {
              // NOTE(benlesh): will not find namespaced attributes. This is by design.
              i += 4;
          }
          else {
              if (maybeAttrName === 1 /* SelectOnly */) {
                  selectOnlyMode = true;
              }
              i += selectOnlyMode ? 1 : 2;
          }
      }
      return -1;
  }
docs: Examines an attributes definition array from a node to find the index of the
  attribute with the specified name.
  
  NOTE: Will not find namespaced attributes.
  
  @param name the name of the attribute to find
  @param attrs the attribute array to examine