function assertValidNodeInfo(descriptor) {
	if (descriptor.node) {
		assert(typeof descriptor.node === "object", "Node must be an object");
	} else {
		assert(
			descriptor.loc,
			"Node must be provided when reporting error if location is not provided",
		);
	}
}
Asserts that either a loc or a node was provided, and the node is valid if it was provided.
@param {MessageDescriptor} descriptor A descriptor to validate
@returns {void}
@throws AssertionError if neither a node nor a loc was provided, or if the node is not an object