Component - 组件函数/类 args - 初始化构造参数 返回增强后的组件对象
349579
function enhance(Component, ...args) {
	let oComp = new Component(...args);

	// 添加字段
	enhanceFields(oComp);	// 组件对象ID等

	// 添加方法
	enhanceRender(oComp);	// 组件渲染
	enhanceState(oComp);	// 组件状态存取
	enhanceRef(oComp);		// 按引用名取DOM节点或组件对象
	enhanceRoot(oComp);		// 取组件根节点DOM元素

	return oComp;
}
436134
function formatArguments(args) {
    if (Array.isArray(args)) {
        return args.map(function (item) {
            return formatArgument(item);
        });
    } else if (typeof args === 'string' || args instanceof String) {
        return [formatArgument(args)];
    }
    console.error(`${PLUGIN_NAME} : Arguments are not passed in a valid format: ${args}`);
    return [];
}
501710
function initCustomComponents() {
    if (typeof projectConfig.crux.components !== 'string') {
      return false;
    }
    var componentPath = path.normalize(global['__rootdir'] + '/' + projectConfig.crux.components + '/'),
      componentList;
    try {
      componentList = util.readDirectoryRelative(componentPath, 'directory', null, true);
    } catch (e) {
      // there are no app components.
      return false;
    }
    var self = this;
    _.forEach(componentList, function(compName) {
      if (self.__components.indexOf('custom:' + compName) === -1) return;
      try {
        var CompClass = require(path.normalize(componentPath + '/' + compName + '/index.js'));
      } catch (e) {
        console.log(e);
        if (e.message.indexOf('Cannot find module') !== -1 && e.message.indexOf('index.js') !== -1) {
          log.warn('Crux.application: Custom component "%s" does not have index.js. Skipping...', compName);
          return;
        }
        e.message = "[Crux.customComponent: " + compName + "] " + e.message;
        throw e;
      }
      if (typeof CompClass !== 'function' || CompClass.prototype.__type !== 'CruxComponent') {
        throw new Error('[Crux.run()] Crux custom component "' + compName + '" does not extend Crux.Component');
      }
      var compConfig = getComponentConfiguration(compName);
      var compObj = new CompClass(compConfig, appConfig);
      if (compObj.name === 'CruxComponent') {
        compObj.name = compName;
      }
      registryObj.register(compObj);
      compObj.registry(registryObj);
    });
  }
414804
function checkArgument(i) {
  let l;

  if (l = checkEscapedString(i)) tokens[i].argument_child = 1;
  else if (l = checkDeclaration(i)) tokens[i].argument_child = 2;
  else if (l = checkVariablesList(i)) tokens[i].argument_child = 3;
  else if (l = checkVariable(i)) tokens[i].argument_child = 4;
  else if (l = checkSC(i)) tokens[i].argument_child = 5;
  else if (l = checkUnary(i)) tokens[i].argument_child = 6;
  else if (l = checkOperator(i)) tokens[i].argument_child = 7;
  else if (l = checkDelim(i)) tokens[i].argument_child = 8;
  else if (l = checkDeclDelim(i)) tokens[i].argument_child = 9;
  else if (l = checkString(i)) tokens[i].argument_child = 10;
  else if (l = checkPercentage(i)) tokens[i].argument_child = 11;
  else if (l = checkDimension(i)) tokens[i].argument_child = 12;
  else if (l = checkNumber(i)) tokens[i].argument_child = 13;
  else if (l = checkUri(i)) tokens[i].argument_child = 14;
  else if (l = checkFunction(i)) tokens[i].argument_child = 15;
  else if (l = checkIdent(i)) tokens[i].argument_child = 16;
  else if (l = checkVhash(i)) tokens[i].argument_child = 17;
  else if (l = checkBlock(i)) tokens[i].argument_child = 18;
  else if (l = checkParentheses(i)) tokens[i].argument_child = 19;

  return l;
}
370874
public static void main(String... args) throws Exception {

        String string = "SELECT :expr1, #($expr2.class),"
                + " WHERE #if(:expr3) {e = $expr3} #else {e IS NULL}"
                + "#for(variant in $expr4.bytes) { AND c = :variant}" // NL
                + " {AND d = :expr-5}? {AND f = $expr6}?" // NL
                + " BY #!(:expr7) ASC";

        // 在输入中查找  PREFIX 字符
        Matcher matcher = PATTERN_KEYWORD.matcher(string);

        int position = 0;

        while (matcher.find(position)) {

            System.out.println("===============================");
            System.out.println("group 0: " + matcher.group(0));
            System.out.println("group 1: " + matcher.group(1));
            System.out.println("group 2: " + matcher.group(2));
            System.out.println("group 3: " + matcher.group(3));

            position = matcher.end();
        }

        // 在循环表达式中查找
        matcher = PATTERN_IN.matcher("variant in :expr5");

        if (matcher.matches()) {

            System.out.println("===============================");
            System.out.println("group 0: " + matcher.group(0));
            System.out.println("group 1: " + matcher.group(1));
            System.out.println("group 2: " + matcher.group(2));
        }

        // 编译下列语句
        ExqlPattern pattern = new ExqlCompiler(string).compile();

        ExqlContext context = new ExqlContextImpl();

        HashMap<String, Object> map = new HashMap<String, Object>();

        map.put("expr1", "expr1");
        map.put("expr2", "expr2");
        map.put("expr3", "expr3");
        map.put("expr4", "expr4");
        map.put("expr5", "expr5");
        // map.put("expr6", "expr6");
        map.put("expr7", "expr7");

        pattern.execute(context, map, map);
        System.out.println(context.flushOut());
        System.out.println(Arrays.toString(context.getArgs()));
    }
1133035
function collectComponent(component) {
    var name = component.constructor.name;
    (components[name] || (components[name] = [])).push(component);
  }
869737
def _bsecurate_cli_print_component_file(args):
    ''''''

    data = fileio.read_json_basis(args.file)
    return printing.component_basis_str(data, elements=args.elements)
827520
function resolveArgument(expr, argIndex) {
    if (typeof argIndex === 'undefined') {
        argIndex = 0;
    }
    if (!expr.arguments.length || !expr.arguments[argIndex]) {
        return;
    }
    this.applyPluginsBailResult('call require:commonjs:item', expr,
            this.evaluateExpression(expr.arguments[argIndex]));
}
351124
function getArgument(name, args) {
  var flags = args || process.argv.slice(2),
    index = flags.lastIndexOf(name);

  if (index === -1 || index + 1 >= flags.length) {
    return null;
  }

  return flags[index + 1];
}
1349968
function Component(options) { // eslint-disable-line

    // #[begin] error
    for (var key in Component.prototype) {
        if (this[key] !== Component.prototype[key]) {
            /* eslint-disable max-len */
            warn('\`' + key + '\` is a reserved key of san components. Overriding this property may cause unknown exceptions.');
            /* eslint-enable max-len */
        }
    }
    // #[end]


    options = options || {};

    this.lifeCycle = LifeCycle.start;
    this.children = [];
    this._elFns = [];
    this.listeners = {};
    this.slotChildren = [];
    this.implicitChildren = [];

    var clazz = this.constructor;

    this.filters = this.filters || clazz.filters || {};
    this.computed = this.computed || clazz.computed || {};
    this.messages = this.messages || clazz.messages || {};

    if (options.transition) {
        this.transition = options.transition;
    }

    this.subTag = options.subTag;

    // compile
    compileComponent(clazz);

    var protoANode = clazz.prototype.aNode;
    preheatANode(protoANode);


    this.tagName = protoANode.tagName;
    this.source = typeof options.source === 'string'
        ? parseTemplate(options.source).children[0]
        : options.source;
    preheatANode(this.source);


    this.sourceSlotNameProps = [];
    this.sourceSlots = {
        named: {}
    };


    this.owner = options.owner;
    this.scope = options.scope;
    this.el = options.el;

    var parent = options.parent;
    if (parent) {
        this.parent = parent;
        this.parentComponent = parent.nodeType === NodeType.CMPT
            ? parent
            : parent && parent.parentComponent;
    }
    else if (this.owner) {
        this.parentComponent = this.owner;
        this.scope = this.owner.data;
    }

    this.id = guid++;

    // #[begin] reverse
    if (this.el) {
        var firstCommentNode = this.el.firstChild;
        if (firstCommentNode && firstCommentNode.nodeType === 3) {
            firstCommentNode = firstCommentNode.nextSibling;
        }

        if (firstCommentNode && firstCommentNode.nodeType === 8) {
            var stumpMatch = firstCommentNode.data.match(/^\s*s-data:([\s\S]+)?$/);
            if (stumpMatch) {
                var stumpText = stumpMatch[1];

                // fill component data
                options.data = (new Function('return '
                    + stumpText
                        .replace(/^[\s\n]*/, '')
                        .replace(
                            /"(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\.\d+Z"/g,
                            function (match, y, mon, d, h, m, s) {
                                return 'new Date(' + (+y) + ',' + (+mon) + ',' + (+d)
                                    + ',' + (+h) + ',' + (+m) + ',' + (+s) + ')';
                            }
                        )
                ))();

                if (firstCommentNode.previousSibling) {
                    removeEl(firstCommentNode.previousSibling);
                }
                removeEl(firstCommentNode);
            }
        }
    }
    // #[end]

    // native事件数组
    this.nativeEvents = [];

    if (this.source) {
        // 组件运行时传入的结构，做slot解析
        this._initSourceSlots(1);

        for (var i = 0, l = this.source.events.length; i < l; i++) {
            var eventBind = this.source.events[i];
            // 保存当前实例的native事件，下面创建aNode时候做合并
            if (eventBind.modifier.native) {
                this.nativeEvents.push(eventBind);
            }
            else {
                // #[begin] error
                warnEventListenMethod(eventBind, options.owner);
                // #[end]

                this.on(
                    eventBind.name,
                    getEventListener(eventBind.expr, options.owner, this.scope, 1),
                    eventBind
                );
            }
        }

        this.tagName = this.tagName || this.source.tagName;
        this.binds = camelComponentBinds(this.source.props);

        // init s-bind data
        nodeSBindInit(this, this.source.directives.bind);
    }

    this._toPhase('compiled');

    // init data
    this.data = new Data(
        extend(
            typeof this.initData === 'function' && this.initData() || {},
            options.data || this._sbindData
        )
    );

    this.tagName = this.tagName || 'div';

    // #[begin] allua
    // ie8- 不支持innerHTML输出自定义标签
    /* istanbul ignore if */
    if (ieOldThan9 && this.tagName.indexOf('-') > 0) {
        this.tagName = 'div';
    }
    // #[end]

    if (this.binds) {
        for (var i = 0, l = this.binds.length; i < l; i++) {
            var bindInfo = this.binds[i];
            postProp(bindInfo);

            if (this.scope) {
                var value = evalExpr(bindInfo.expr, this.scope, this.owner);
                if (typeof value !== 'undefined') {
                    // See: https://github.com/ecomfe/san/issues/191
                    this.data.set(bindInfo.name, value);
                }
            }
        }
    }

    // #[begin] error
    // 在初始化 + 数据绑定后，开始数据校验
    // NOTE: 只在开发版本中进行属性校验
    var dataTypes = this.dataTypes || clazz.dataTypes;
    if (dataTypes) {
        var dataTypeChecker = createDataTypesChecker(
            dataTypes,
            this.subTag || this.name || clazz.name
        );
        this.data.setTypeChecker(dataTypeChecker);
        this.data.checkDataTypes();
    }
    // #[end]

    this.computedDeps = {};
    for (var expr in this.computed) {
        if (this.computed.hasOwnProperty(expr) && !this.computedDeps[expr]) {
            this._calcComputed(expr);
        }
    }

    this.dataChanger = bind(this._dataChanger, this);
    this.data.listen(this.dataChanger);

    this._toPhase('inited');

    // #[begin] reverse
    if (this.el) {
        reverseElementChildren(this, this.data, this);
        this._toPhase('created');
        this._attached();
        this._toPhase('attached');
    }
    else {
        var walker = options.reverseWalker;
        if (walker) {
            var ifDirective = this.aNode.directives['if']; // eslint-disable-line dot-notation

            if (!ifDirective || evalExpr(ifDirective.value, this.data, this)) {
                var currentNode = walker.current;
                if (currentNode && currentNode.nodeType === 1) {
                    this.el = currentNode;
                    walker.goNext();
                }

                reverseElementChildren(this, this.data, this);
            }
            else {
                this.el = document.createComment(this.id);
                insertBefore(this.el, walker.target, walker.current);
            }

            this._toPhase('created');
            this._attached();
            this._toPhase('attached');
        }
    }
    // #[end]
}
1185525
function argumentFilter(args){
		var ret;
		if (typeof args[0] == 'object') {
			args=args[0];
			ret={};
			for (var i in args) if (args.hasOwnProperty(i) && typeof args[i] == 'function') {
				ret[i]=args[i];
			}
			return ret;
		}
		ret=[];
		for (var i=0,ii=args.length;i<ii;i++) if (typeof args[i] == 'function') {
			ret.push(args[i]);
		}
		return ret;
	}
1007624
function getComponents(file) {
    var relativePath = file.relative;
    var pathParts = Path.dirname(relativePath).split(Path.sep);
    return {
        ext: Path.extname(relativePath).substr(1), // strip dot
        filename: Path.basename(relativePath),
        packageName: pathParts[0]
    };
}
1143908
function getComponent(aType) {
      var ucname = aType.toUpperCase();
      return (ucname in this.parts ? this.parts[ucname].slice() : []);
    }
657182
def main_component_path(component)
      current_params = try(:params) || {}
      EngineRouter.main_proxy(component).root_path(locale: current_params[:locale])
    end
217858
function parseArgs (argv, args) {
  var argc = argv.length;
  var sel;
  if (argc === 1) {
    var arg = argv[0];
    if (typeof arg === 'string') {
      // selector with no arguments
      sel = arg;
    } else {
      // legacy API: an Object was passed in
      sel = [];
      Object.keys(arg).forEach(function (s) {
        sel.push(s);
        args.push(arg[s]);
      });
      sel.push('');
      sel = sel.join(':');
    }
  } else {
    // varargs API
    sel = [];
    for (var i=0; i<argc; i+=2) {
      sel.push(argv[i]);
      args.push(argv[i+1]);
    }
    sel.push('');
    sel = sel.join(':');
  }
  return sel;
}
1197796
function callNativeComponent (instanceId, ref, method, args, options) {
  return processCall(instanceId, {
    component: options.component,
    ref,
    method,
    args
  })
}
1076983
def main_component_url(component)
      current_params = try(:params) || {}
      EngineRouter.main_proxy(component).root_url(locale: current_params[:locale])
    end