function createReferenceMap(scope, outReferenceMap = new Map()) {
	for (const reference of scope.references) {
		if (reference.resolved === null) {
			continue;
		}

		outReferenceMap.set(reference.identifier, reference);
	}
	for (const childScope of scope.childScopes) {
		if (childScope.type !== "function") {
			createReferenceMap(childScope, outReferenceMap);
		}
	}

	return outReferenceMap;
}
Make the map from identifiers to each reference.
@param {escope.Scope} scope The scope to get references.
@param {Map<Identifier, escope.Reference>} [outReferenceMap] The map from identifier nodes to each reference object.
@returns {Map<Identifier, escope.Reference>} `referenceMap`.