getVarFromNode( node, name = null, type = node.getNodeType( this ), shaderStage = this.shaderStage, readOnly = false ) {

		const nodeData = this.getDataFromNode( node, shaderStage );

		let nodeVar = nodeData.variable;

		if ( nodeVar === undefined ) {

			const idNS = readOnly ? '_const' : '_var';

			const vars = this.vars[ shaderStage ] || ( this.vars[ shaderStage ] = [] );
			const id = this.vars[ idNS ] || ( this.vars[ idNS ] = 0 );

			if ( name === null ) {

				name = ( readOnly ? 'nodeConst' : 'nodeVar' ) + id;

				this.vars[ idNS ] ++;

			}

			//

			const count = this.getArrayCount( node );

			nodeVar = new NodeVar( name, type, readOnly, count );

			if ( ! readOnly ) {

				vars.push( nodeVar );

			}

			this.registerDeclaration( nodeVar );

			nodeData.variable = nodeVar;

		}

		return nodeVar;

	}
Returns an instance of {@link NodeVar} for the given variable node.

@param {VarNode} node - The variable node.
@param {?string} name - The variable's name.
@param {string} [type=node.getNodeType( this )] - The variable's type.
@param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage.
@param {boolean} [readOnly=false] - Whether the variable is read-only or not.

@return {NodeVar} The node variable.