lib/class_manager.js
function(path_segments) {

		var namespace,
			segment_name,
			count = path_segments.length,
			i = 1;

		if (!count) Lava.t("ClassManager: class names must include a namespace, even for global classes.");
		if (!(path_segments[0] in this._root)) Lava.t("[ClassManager] namespace is not registered: " + path_segments[0]);
		namespace = this._root[path_segments[0]];

		for (; i < count; i++) {

			segment_name = path_segments[i];

			if (!(segment_name in namespace)) {

				namespace[segment_name] = {};

			}

			namespace = namespace[segment_name];

		}

		return namespace;

	}
function(path_segments) {

		var namespace,
			segment_name,
			count = path_segments.length,
			i = 1;

		if (!count) Lava.t("ClassManager: class names must include a namespace, even for global classes.");
		if (!(path_segments[0] in this._root)) Lava.t("[ClassManager] namespace is not registered: " + path_segments[0]);
		namespace = this._root[path_segments[0]];

		for (; i < count; i++) {

			segment_name = path_segments[i];

			if (!(segment_name in namespace)) {

				namespace[segment_name] = {};

			}

			namespace = namespace[segment_name];

		}

		return namespace;

	}
function ( path_segments ) { var namespace , segment_name , count = path_segments . length , i = 1 ; if ( ! count ) Lava . t ( "ClassManager: class names must include a namespace, even for global classes." ) ; if ( ! ( path_segments [ 0 ] in this . _root ) ) Lava . t ( "[ClassManager] namespace is not registered: " + path_segments [ 0 ] ) ; namespace = this . _root [ path_segments [ 0 ] ] ; for ( ; i < count ; i ++ ) { segment_name = path_segments [ i ] ; if ( ! ( segment_name in namespace ) ) { namespace [ segment_name ] = { } ; } namespace = namespace [ segment_name ] ; } return namespace ; }
Get namespace for a class constructor
@param {Array.<string>} path_segments Path to the namespace of a class. Must start with one of registered roots
@returns {Object}
Get namespace for a class constructor