src/core/base/wnComponent.js
function (className,config,path,npmPath)
		{
			var source = this.c || process.wns;
			var instance;
			var builder = this.getComponent&&this.getComponent('classBuilder');

			if (!source || !source[className])
			 { return false; }

			if (config.id)
				source[className].build.id = config.id;

			if (source[className].build.extend.indexOf('wnModule')!==-1)
			{
				instance = new source[className](self,config,path,npmPath,builder.classesPath);
			}
			else
				instance = new source[className](config,source);

			if (WNS_TEST && builder)
			{
				console.log('- Testing '+className)
				var tests = builder.classes[className].test;
				for (t in tests)
				{
					//console.log('Testing: '+t);
					tests[t](instance);
				}
			}
			return instance;
		}
function (className,config,path,npmPath)
		{
			var source = this.c || process.wns;
			var instance;
			var builder = this.getComponent&&this.getComponent('classBuilder');

			if (!source || !source[className])
			 { return false; }

			if (config.id)
				source[className].build.id = config.id;

			if (source[className].build.extend.indexOf('wnModule')!==-1)
			{
				instance = new source[className](self,config,path,npmPath,builder.classesPath);
			}
			else
				instance = new source[className](config,source);

			if (WNS_TEST && builder)
			{
				console.log('- Testing '+className)
				var tests = builder.classes[className].test;
				for (t in tests)
				{
					//console.log('Testing: '+t);
					tests[t](instance);
				}
			}
			return instance;
		}
function ( className , config , path , npmPath ) { var source = this . c || process . wns ; var instance ; var builder = this . getComponent && this . getComponent ( 'classBuilder' ) ; if ( ! source || ! source [ className ] ) { return false ; } if ( config . id ) source [ className ] . build . id = config . id ; if ( source [ className ] . build . extend . indexOf ( 'wnModule' ) !== - 1 ) { instance = new source [ className ] ( self , config , path , npmPath , builder . classesPath ) ; } else instance = new source [ className ] ( config , source ) ; if ( WNS_TEST && builder ) { console . log ( '- Testing ' + className ) var tests = builder . classes [ className ] . test ; for ( t in tests ) { //console.log('Testing: '+t); tests [ t ] ( instance ) ; } } return instance ; }
Create an class from the classSources.
@param string $className name of the class
@param object $config class configuration
@param component $boolean is it component format?
@return boolean|object
Create an class from the classSources .