code: function resolveIds(schema) {
    var schemaId = normalizeId(this._getId(schema));
    var baseIds = {'': schemaId};
    var fullPaths = {'': getFullPath(schemaId, false)};
    var localRefs = {};
    var self = this;
  
    traverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
      if (jsonPtr === '') return;
      var id = self._getId(sch);
      var baseId = baseIds[parentJsonPtr];
      var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword;
      if (keyIndex !== undefined)
        fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex));
  
      if (typeof id == 'string') {
        id = baseId = normalizeId(baseId ? URI.resolve(baseId, id) : id);
  
        var refVal = self._refs[id];
        if (typeof refVal == 'string') refVal = self._refs[refVal];
        if (refVal && refVal.schema) {
          if (!equal(sch, refVal.schema))
            throw new Error('id "' + id + '" resolves to more than one schema');
        } else if (id != normalizeId(fullPath)) {
          if (id[0] == '#') {
            if (localRefs[id] && !equal(sch, localRefs[id]))
              throw new Error('id "' + id + '" resolves to more than one schema');
            localRefs[id] = sch;
          } else {
            self._refs[id] = fullPath;
          }
        }
      }
      baseIds[jsonPtr] = baseId;
      fullPaths[jsonPtr] = fullPath;
    });
  
    return localRefs;
  }
docs: /* @this Ajv