*iterateFiles(patternOrPatterns) {
		const { globInputPaths, errorOnUnmatchedPattern } =
			internalSlotsMap.get(this);
		const patterns = Array.isArray(patternOrPatterns)
			? patternOrPatterns
			: [patternOrPatterns];

		debug("Start to iterate files: %o", patterns);

		// The set of paths to remove duplicate.
		const set = new Set();

		for (const pattern of patterns) {
			let foundRegardlessOfIgnored = false;
			let found = false;

			// Skip empty string.
			if (!pattern) {
				continue;
			}

			// Iterate files of this pattern.
			for (const { config, filePath, flag } of this._iterateFiles(
				pattern,
			)) {
				foundRegardlessOfIgnored = true;
				if (flag === IGNORED_SILENTLY) {
					continue;
				}
				found = true;

				// Remove duplicate paths while yielding paths.
				if (!set.has(filePath)) {
					set.add(filePath);
					yield {
						config,
						filePath,
						ignored: flag === IGNORED,
					};
				}
			}

			// Raise an error if any files were not found.
			if (errorOnUnmatchedPattern) {
				if (!foundRegardlessOfIgnored) {
					throw new NoFilesFoundError(
						pattern,
						!globInputPaths && isGlob(pattern),
					);
				}
				if (!found) {
					throw new AllFilesIgnoredError(pattern);
				}
			}
		}

		debug(`Complete iterating files: ${JSON.stringify(patterns)}`);
	}
Iterate files which are matched by given glob patterns.
@param {string|string[]} patternOrPatterns The glob patterns to iterate files.
@throws {NoFilesFoundError|AllFilesIgnoredError} On an unmatched pattern.
@returns {IterableIterator<FileAndConfig>} The found files.