function isReferenceToGlobalVariable(scope, node) {
	const reference = scope.references.find(ref => ref.identifier === node);

	return Boolean(
		reference &&
			reference.resolved &&
			reference.resolved.scope.type === "global" &&
			reference.resolved.defs.length === 0,
	);
}
Checks if an identifier is a reference to a global variable.
@param {Scope} scope The scope in which the identifier is referenced.
@param {ASTNode} node An identifier node to check.
@returns {boolean} `true` if the identifier is a reference to a global variable.