addScopeSymbols = (s, nameSet, scopeSet1, scopeSet2) => {
	let scope = s;
	while (scope) {
		if (scopeSet1.has(scope)) break;
		if (scopeSet2.has(scope)) break;
		scopeSet1.add(scope);
		for (const variable of scope.variables) {
			nameSet.add(variable.name);
		}
		scope = scope.upper;
	}
}
@param {Scope | null} s scope
@param {UsedNames} nameSet name set
@param {ScopeSet} scopeSet1 scope set 1
@param {ScopeSet} scopeSet2 scope set 2