获取组件的依赖的js 插件 并 去掉重复的 引用
425663
private static function getRelyOnJsPlugin(){

        $component = $arr = [];
        foreach(self::$components as $k => $v){
            $component[$k] = $v['component_name'];
        }
        $component_unique = array_unique($component);


        foreach($component_unique as $k => $v){
            $class = self::getClass($v);

            if($class::relyOnJsPlugin(self::$StaticPath)){

                //初始化组件的 唯一id
                $arr[] = $class::relyOnJsPlugin(self::$StaticPath);
            }

        }



        $box  = [];
        //组件css 和 js 的引用
        foreach($arr as $k => $v){

            if(!is_array($v))throw new \ErrorException($class.' relyOnJsPlugin 方法 返回值需要是数组');

            foreach($v as $sk => $sv){
                switch($sk){
                    case 'css':
                        $tag = ['link','href'];
                        break;
                    case 'js':

                        $tag = ['script','src'];
                        break;
                }
                array_walk($sv,function($a)use(&$str, $tag,$sk,&$box){
                    $str ='<'.$tag[0].' ';
                    if($sk == 'css'){
                        $a['attr']['rel'] = isset($a['attr']['rel']) ? $a['attr']['rel'] : 'stylesheet';
                    }
                    if($sk == 'js'){
                        $a['attr']['type'] = isset($a['attr']['type']) ? $a['attr']['type'] : 'text/javascript';
                    }
                    foreach($a as $K => $V){
                        if($K == 'path'){
                            $str .= ' '.$tag[1].'="'.$V.'" ';
                        }else{
                            foreach($V as $kk => $vv){
                                $str .= $kk .'="'.$vv.'" ';
                            }
                        }
                    }
                    if($sk == 'css'){
                        $str .= ' />';
                    }
                    if($sk == 'js'){
                        $str .= '></'.$tag[0].'>';
                    }
                    $box[] = $str;
                });
            }
        }

        //去掉重复的 引用
        $box = array_unique($box);
        //var_dump($box);
        return join("\r\n",$box);


    }
102445
function () {
/*Line 416 - 'AtomItemsControl.js' */                if (this.scrollTimeout) {
/*Line 417 - 'AtomItemsControl.js' */                    clearTimeout(this.scrollTimeout);
/*Line 418 - 'AtomItemsControl.js' */                }
/*Line 419 - 'AtomItemsControl.js' */                var _this = this;
/*Line 420 - 'AtomItemsControl.js' */                this.scrollTimeout = setTimeout(function () {
/*Line 421 - 'AtomItemsControl.js' */                    _this.scrollTimeout = 0;
/*Line 422 - 'AtomItemsControl.js' */                    _this.onCollectionChangedInternal("refresh", -1, null);
/*Line 423 - 'AtomItemsControl.js' */                }, 1000);
/*Line 424 - 'AtomItemsControl.js' */            }
73680
function __init(opts) {
    //扩展参数
    extend(this.options, opts || (opts = {}));
    //获取目标元素
    this.appearWatchElements = this.appearWatchElements || __getElements.call(this, '.' + this.options.cls);
    //初始化位置信息
    __initBoundingRect.call(this, this.appearWatchElements);
    //绑定事件
    __bindEvent.call(this);
  }
1092388
function () {
	var trans = [
		[ "zh_tw" , "hello" ]
	];
		
	for ( var i in trans){
		console.log(i);
	}
	
	SR.DB.setData(i18nDB, {zh_tw:{hello: "哈囉"}}, function(){}, function(){});
	SR.DB.setData(i18nDB, {zh_tw:{say: "說"}}, function(){}, function(){});
	SR.DB.setData(i18nDB, {zh_tw:{see: "看"}}, function(){}, function(){});
	//SR.DB.setData("language", {"zh_tw":{"hello": "哈囉"}}, function(){}, function(){});
}
930405
public String listJs() {

        StringBuffer js = new StringBuffer(1024);
        CmsMessages messages = Messages.get().getBundle(getWp().getLocale());
        js.append("<script type='text/javascript' src='");
        js.append(CmsWorkplace.getSkinUri());
        js.append("jquery/unpacked/jquery.js'></script>\n");
        js.append("<script type='text/javascript' src='");
        js.append(CmsWorkplace.getSkinUri());
        js.append("jquery/unpacked/jquery.hint.js'></script>\n");
        js.append("<script type='text/javascript' src='");
        js.append(CmsWorkplace.getSkinUri());
        js.append("admin/javascript/list.js'></script>\n");
        if (!m_metadata.getMultiActions().isEmpty()) {
            js.append("<script type='text/javascript'>\n");
            js.append("\tvar ");
            js.append(NO_SELECTION_HELP_VAR);
            js.append(" = '");
            js.append(CmsStringUtil.escapeJavaScript(messages.key(Messages.GUI_LIST_ACTION_NO_SELECTION_0)));
            js.append("';\n");
            Iterator<CmsListMultiAction> it = m_metadata.getMultiActions().iterator();
            while (it.hasNext()) {
                CmsListMultiAction action = it.next();
                if (action instanceof CmsListRadioMultiAction) {
                    CmsListRadioMultiAction rAction = (CmsListRadioMultiAction)action;
                    js.append("\tvar ");
                    js.append(NO_SELECTION_MATCH_HELP_VAR);
                    js.append(rAction.getId());
                    js.append(" = '");
                    js.append(
                        CmsStringUtil.escapeJavaScript(
                            messages.key(
                                Messages.GUI_LIST_ACTION_NO_SELECTION_MATCH_1,
                                new Integer(rAction.getSelections()))));
                    js.append("';\n");
                }
            }
            js.append("</script>\n");
        }
        return js.toString();
    }
291017
function () {
/*Line 1042 - 'AtomItemsControl.js' */                base.onUpdateUI.call(this);

/*Line 1044 - 'AtomItemsControl.js' */                if (this._uiVirtualize) {
/*Line 1045 - 'AtomItemsControl.js' */                    this.onVirtualCollectionChanged();
/*Line 1046 - 'AtomItemsControl.js' */                }

/*Line 1048 - 'AtomItemsControl.js' */                var ae = new ChildEnumerator(this._itemsPresenter);
/*Line 1049 - 'AtomItemsControl.js' */                while (ae.next()) {
/*Line 1050 - 'AtomItemsControl.js' */                    var item = ae.current();
/*Line 1051 - 'AtomItemsControl.js' */                    if (!item.atomControl)
/*Line 1052 - 'AtomItemsControl.js' */                        continue;
/*Line 1053 - 'AtomItemsControl.js' */                    var dataItem = item.atomControl.get_data();
/*Line 1054 - 'AtomItemsControl.js' */                    AtomBinder.refreshValue(item.atomControl.get_scope(), "itemSelected");
/*Line 1055 - 'AtomItemsControl.js' */                    this.applyItemStyle(item, dataItem, ae.isFirst(), ae.isLast());
/*Line 1056 - 'AtomItemsControl.js' */                }
/*Line 1057 - 'AtomItemsControl.js' */            }
367587
function(javascript) {
    try {
      return Promise.resolve({
        input: javascript,
        output: eval(javascript),
        exception: null
      });
    }
    catch (ex) {
      return Promise.resolve({
        input: javascript,
        output: null,
        exception: ex
      });
    }
  }
1262613
private String parseJavascriptSource(String js) throws Exception {

    boolean isJS = true;
    boolean isSingQuot = false;
    boolean isDblQuot = false;
    boolean isSlash = false;
    boolean isCComment = false;
    boolean isCPPComment = false;
    boolean isRegex = false;
    boolean isOper = false;

    StringBuilder ret = new StringBuilder();
    String tmp = "";
    Character last = 0;
    Character prev = 0;

    for (int i = 0, l = js.length(); i < l; i++) {
      Character c = js.charAt(i);
      String out = c.toString();

      if (isJS) {
        isDblQuot = c == '"';
        isSingQuot = c == '\'';
        isSlash = c == '/';
        isJS = !isDblQuot && !isSingQuot && !isSlash;
        if (!isJS) {
          out = tmp = "";
          isCPPComment = isCComment = isRegex = false;
        }
      } else if (isSingQuot) {
        isJS = !(isSingQuot = last == '\\' || c != '\'');
        if (isJS)
          out = escapeQuotedString(tmp, c);
        else
          tmp += c;
      } else if (isDblQuot) {
        isJS = !(isDblQuot = last == '\\' || c != '"');
        if (isJS)
          out = escapeQuotedString(tmp, c);
        else
          tmp += c;
      } else if (isSlash) {
        if (!isCPPComment && !isCComment && !isRegex && !isOper) {
          isCPPComment = c == '/';
          isCComment = c == '*';
          isOper = !isCPPComment && !isCComment && !"=(&|?:;},".contains("" + prev);
          isRegex = !isCPPComment && !isCComment && !isOper;
        }
        if (isOper) {
          isJS = !(isSlash = isOper = false);
          out = "" + last + c;
        } else if (isCPPComment) {
          isJS = !(isSlash = isCPPComment = c != '\n');
          if (isJS)
            out = "\n";
        } else if (isCComment) {
          isSlash = isCComment = !(isJS = last == '*' && c == '/');
          if (isJS)
            out = "";
        } else if (isRegex) {
          isJS = !(isSlash = isRegex = last == '\\' || c != '/');
          if (isJS) {
            String mod = "";
            while (++i < l) {
              c = js.charAt(i);
              if ("igm".contains("" + c))
                mod += c;
              else
                break;
            }
            out = escapeInlineRegex(tmp, mod) + c;
          } else {
            tmp += c;
          }
        } else {
          isJS = true;
        }
      }

      if (isJS) {
        ret.append(out);
      }
      if (last != ' ') {
        prev = last;
      }
      last = prev == '\\' && c == '\\' ? 0 : c;
    }
    return ret.toString();
  }
486483
function() {
    var obj = {};
    var self = this;

    Object
      .keys(this)
      .forEach(function(key) {

        // 过滤掉私有属性。 _key
        // 但是不过滤 __key
        if (key !== 'cache' && key !== 'url' && !/^_[^_]/.test(key)) {
          obj[key] = self[key];
        }
      });

    return obj;
  }
596570
function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";
i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div");
k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display=
"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:11,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height=
a+"px",m=b,r=0);return b},update:function(){l=this.end()}}}
718348
function() {
    var jsPath, scripts, i;
    if (_document.currentScript && (jsPath = _document.currentScript.src)) {
      return jsPath;
    }
    scripts = _document.getElementsByTagName("script");
    if (scripts.length === 1) {
      return scripts[0].src || undefined;
    }
    if ("readyState" in (scripts[0] || document.createElement("script"))) {
      for (i = scripts.length; i--; ) {
        if (scripts[i].readyState === "interactive" && (jsPath = scripts[i].src)) {
          return jsPath;
        }
      }
    }
    if (_document.readyState === "loading" && (jsPath = scripts[scripts.length - 1].src)) {
      return jsPath;
    }
    if (jsPath = _getCurrentScriptUrlFromError()) {
      return jsPath;
    }
    return undefined;
  }
1092383
function init(element, callback, extraOptions /* Internal Use Only */ ) {
            // 初始化任务队列
            // var queue = Util.queue() // #20

            // 如果已经被初始化，则立即返回
            var clientId = element.clientId
            if (clientId !== undefined) {
                if (callback) callback(undefined, CACHE[clientId])
                return
            }

            // 如果没有模块标识符，则不需要初始化
            if (!element.getAttribute(Constant.ATTRS.id)) {
                if (callback) callback(undefined, undefined)
                return
            }

            // 1. 解析配置项
            var options = Options.parse(element)
            if (extraOptions) Util.extend(options, extraOptions)

            var BrixImpl, instance

            var label = 'module ' + options.moduleId + ' ' + options.clientId
            if (DEBUG) {
                console.group(label)
                console.time(label)
                var _callback = callback
                callback = function(error, instance) {
                    console.timeEnd(label)
                    console.groupEnd(label)
                    if (_callback) _callback(error, instance)
                }
            }

            __loadModule()

            function __loadModule(next) {
                next = next || __createInstance

                // 2. 加载组件模块
                // load module file
                /* jshint unused:false */
                // try {
                //     // 尝试快速获取已经加载过的模块
                //     BrixImpl = require(options.moduleId)
                //     setTimeout(next, 4)
                //     return
                // } catch (error) {}

                require([options.moduleId], function __loadModuleComplete(module) {
                    BrixImpl = module
                    next()
                }, function(error) {
                    // http://requirejs.org/docs/api.html#errbacks
                    if (callback) callback(new Error(error.message), instance)
                    else console.error(error.stack || error)

                    if (Loader.onerror) {
                        error.moduleId = options.moduleId
                        Loader.onerror(error) // 运行时异常收集
                    }
                })
            }

            function __createInstance(next) {
                next = next || __interceptInstanceDestroy

                try {
                    // 在组件模块上附加标记 __x_created_with，指示负责初始化的是 Brix Loader
                    // Add a mark to component module, indicating the Brix Loader is response for the initializing.
                    var __x_created_with = BrixImpl.__x_created_with
                    BrixImpl.__x_created_with = 'Brix Loader'

                    // 3. 创建组件实例（按需传入参数 options）
                    // Create a new module instance
                    instance = BrixImpl.length ? new BrixImpl(options) : new BrixImpl()

                    // 恢复标记
                    // Recovery the mark
                    BrixImpl.__x_created_with = __x_created_with

                    // 设置实例属性 options
                    instance.options = Util.extend(true, {}, instance.options, options)

                    // 设置其他公共属性
                    Util.extend(instance, Util.pick(options, Constant.OPTIONS))
                    instance.element.setAttribute('data-clientId', options.clientId)

                    next()
                } catch (error) {
                    if (callback) callback(error, instance)
                    else console.error(error.stack || error)

                    if (Loader.onerror) {
                        error.moduleId = options.moduleId
                        Loader.onerror(error) // 运行时异常收集
                    }
                }
            }

            function __interceptInstanceDestroy(next) {
                next = next || __cacheInstance

                // 拦截销毁方法
                // intercept destroy method of the module instance
                instance._destroy = instance.destroy
                instance.destroy = function() {
                    destroy(false, instance)
                }
                next()
            }

            function __cacheInstance(next) {
                next = next || __callInstanceInitialization

                // 缓存起来，关联父组件
                // cache the module instance
                cache(instance)
                next()
            }

            function __callInstanceInitialization(next) {
                next = next || __interceptInstanceRender

                // 4. 执行初始化
                // exec module instance initialize
                if (!instance.init) {
                    next()
                    return
                }

                try {
                    if (DEBUG) console.time(label + ' call  init')
                    var result = instance.init()
                    if (DEBUG) console.timeEnd(label + ' call  init')

                    // 如果返回了 Promise，则依赖 Promise 的状态
                    if (result && result.then) {
                        result.then(function() {
                            next()
                        }, function(error) {
                            throw error
                        })
                    } else {
                        next()
                    }
                } catch (error) {
                    if (callback) callback(error, instance)
                    else console.error(error)

                    if (Loader.onerror) {
                        error.moduleId = options.moduleId
                        Loader.onerror(error) // 运行时异常收集
                    }
                }
            }

            function __interceptInstanceRender(next) {
                next = next || __callInstanceRender

                // 拦截渲染方法
                // intercept render method of the module instance
                if (instance._render) {
                    next()
                    return
                }

                instance._render = instance.render
                instance.render = function() {
                    var deferred = Util.defer()
                    var promise = deferred.promise

                    // 如果存在已经被渲染的子组件，则先销毁
                    var hasRenderedChildren
                    if (instance.childClientIds.length) {
                        hasRenderedChildren = true
                        Util.each(instance.childClientIds, function(childClientId) {
                            if (CACHE[childClientId]) destroy(childClientId)
                        })
                    }
                    // 调用组件的 .render()
                    var result
                    if (instance._render) result = instance._render.apply(instance, arguments)
                    else console.warn(instance.clientId, instance.moduleId, 'render() is not defined')

                    // 如果返回了 Promise，则依赖 Promise 的状态
                    if (result && result.then) {
                        result.then(function() {
                            renderChildren()
                            syncClientId()
                        }, function(error) {
                            throw error
                        })
                    } else {
                        renderChildren()
                        syncClientId()
                    }

                    return promise

                    // 再次初始化子组件
                    function renderChildren() {
                        if (hasRenderedChildren) {
                            boot(instance.element, function( /* context */ ) {
                                deferred.resolve()
                            })
                        } else {
                            deferred.resolve()
                        }
                    }

                    // 同步 clientId
                    function syncClientId() {
                        var relatedElement = instance.relatedElement || instance.$relatedElement
                        if (relatedElement) {
                            // element
                            if (relatedElement.nodeType && (relatedElement.clientId === undefined)) {
                                relatedElement.clientId = options.clientId
                            } else if (relatedElement.length) {
                                // [ element ]
                                Util.each(relatedElement, function(item /*, index*/ ) {
                                    if (item.nodeType && (item.clientId === undefined)) {
                                        item.clientId = options.clientId
                                        item.setAttribute('data-moduleId', options.moduleId)
                                        item.setAttribute('data-clientId', options.clientId)
                                    }
                                })
                            }
                        }
                    }

                }
                next()
            }

            function __callInstanceRender(next) {
                next = next || __bindLifecycleEvent

                // 5. 执行渲染（不存在怎么办？必须有！）
                // exec render method of the module instance
                try {
                    if (DEBUG) console.time(label + ' call  render')
                    var result = instance.render(function(error /*, instance*/ ) {
                        if (error) {}
                    })
                    if (DEBUG) console.timeEnd(label + ' call  render')

                    // deferred
                    if (result && result.then) {
                        result.then(function() {
                            next()
                        }, function(error) {
                            if (callback) callback(error, instance)
                            else console.error(error.stack || error)

                            if (Loader.onerror) {
                                error.moduleId = options.moduleId
                                Loader.onerror(error) // 运行时异常收集
                            }
                        })
                    } else {
                        next()
                    }
                } catch (error) {
                    // TODO 渲染时发生错误的组件是否应该自动销毁？
                    if (callback) callback(error, instance)
                    else console.error(error.stack || error)

                    if (Loader.onerror) {
                        error.moduleId = options.moduleId
                        Loader.onerror(error) // 运行时异常收集
                    }
                }
            }

            function __bindLifecycleEvent(next) {
                next = next || __inspectDescendants

                // 绑定测试事件
                // bind lifecycle event of the module instance
                if (DEBUG && instance.on) {
                    Util.each(Constant.EVENTS, function(type) {
                        instance.on(type + Constant.LOADER_NAMESPACE, function(event) {
                            console.log(label, 'event', event.type)
                        })
                    })
                }
                next()
                    // .delay(100) // 每个组件之间的渲染间隔 100ms，方便观察
            }

            function __inspectDescendants(next) {
                next = next || __triggerReadyEvent

                // 检测是否有后代组件
                var descendants = element.getElementsByTagName('*')
                var hasBrixElement = false
                Util.each(descendants, function(descendant /*, index*/ ) {
                    if (descendant.nodeType !== 1) return
                    if (!hasBrixElement &&
                        descendant.getAttribute(Constant.ATTRS.id)) {
                        hasBrixElement = true
                    }
                })

                // 7. 如果有后代组件，则递归加载
                // boot descendants recursively
                if (hasBrixElement) {
                    boot(instance, function() {
                        next()
                    })
                } else {
                    // 如果没有后代组件，那么此时当前组件已经就绪。
                    next()
                }
            }

            function __triggerReadyEvent( /*next*/ ) {
                // 8. 当前组件和后代组件的渲染都完成后，触发 ready 事件
                // trigger ready event after current module instance and it's descendants are rendered
                if (instance.triggerHandler) {
                    instance.triggerHandler(Constant.EVENTS.ready)
                }
                if (callback) callback(undefined, instance)
            }
        }
284051
function htmlParse() {
  var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '<div></div>';
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var transData = {}; //存放转化后的数据

  var res = {}; //返回的数据

  transData = (0, _html2json.html2json)(data, 'root', options); // console.log('解析结果是', transData);

  res = transData;
  return res;
}
221850
function () {
/*Line 41 - 'AtomItemsControl.js' */                if (!this._valueSeparator)
/*Line 42 - 'AtomItemsControl.js' */                    return;
/*Line 43 - 'AtomItemsControl.js' */                if (!this._valuePath)
/*Line 44 - 'AtomItemsControl.js' */                    return;
/*Line 45 - 'AtomItemsControl.js' */                var list = [];
/*Line 46 - 'AtomItemsControl.js' */                var vp = this._valuePath;
/*Line 47 - 'AtomItemsControl.js' */                var vfp = function (item) {
/*Line 48 - 'AtomItemsControl.js' */                    return item[vp];
/*Line 49 - 'AtomItemsControl.js' */                };
/*Line 50 - 'AtomItemsControl.js' */                var ae = Atom.query(this.get_dataItems());
/*Line 51 - 'AtomItemsControl.js' */                while (ae.next()) {
/*Line 52 - 'AtomItemsControl.js' */                    list.push( vfp( ae.current()));                    
/*Line 53 - 'AtomItemsControl.js' */                }
/*Line 54 - 'AtomItemsControl.js' */                return list.join(this._valueSeparator);
/*Line 55 - 'AtomItemsControl.js' */            }
1276419
function (e) {
    var self = this
    var info = this.getInfo()
    var subs = this._subs
    var i
    var l

    // 如果不等于上次方向，则触发
    if (info.landscape !== this.info.landscape) {
      this.info = merge(info)
      info.originEvent = e
      info.originType = e.type

      // 执行on
      for (i = 0, l = subs.on.length; i < l; i++) {
        subs.on[i].call(self, e)
      }

      // 执行after
      setTimeout(function () {
        for (i = 0, l = subs.after.length; i < l; i++) {
          subs.after[i].call(self, e)
        }
      }, 0)
    }
  }
371541
function () {

    var keys = Object.keys(wating);

    /*
     * 检测依赖关系，
     * FIXME 暂时未处理循环依赖.以及始终不满足执行条件的情况.
     */
    keys.forEach(function (name) {
        var args = [];
        var factory = wating[name][0];
        var depends = wating[name][1];
        var done = wating[name][2];

        var canDo = depends.every(function (name) {

            // 插件系统中内容优先，资源池中置后
            var value = working[name] || Resource[name];

            if (value) {
                args.push(value);
                return true;
            }

            return false;
        });

        if (canDo) {
            // 先移除，防止callback中检测依赖时产生的循环
            delete wating[name];

            //  判断异步及同步
            if (done) {
                args.push(done);
                factory.apply( {}, args);
            } else {
                try {
                    var value = working[name] = factory.apply( {}, args);

                    oldDefineOfPlugin.call(Plugin, name, value);
                }catch(err) {
                    stdLog(['%s, can not start the plug-in [%s], \nstack:', err.stack, name], 'crash');
                    process.exit(0);
                    return;
                }
            }
        }
    });
}
680098
function (_getType) {
    var getType = _getType || 'Native2Webkit'; // 获取类型，默认是获取兼容WebKit的语言标识数组

    var defaultLanguage = 'en';
    // 本地对应浏览器的语言标识
    var NativeApple2WebKitLanguageMap = this.nativeApple2WebKitLanguageMap;

    if (getType === 'Native2Webkit') { // 先获取Native的语言，然后查找Map
      var appleLanguage = 'en-US';
      if ($bc_$4.pN) {
        appleLanguage = $bc_$4.pN.app.curAppleLanguage();
      }

      if (NativeApple2WebKitLanguageMap.hasOwnProperty(appleLanguage)) {
        return NativeApple2WebKitLanguageMap[appleLanguage]
      }

      var n2wKeys = Object.getOwnPropertyNames(NativeApple2WebKitLanguageMap);
      for (var i = 0; i < n2wKeys.length; ++i) {
        var valueList = NativeApple2WebKitLanguageMap[n2wKeys[i]];
        if (valueList.indexOf(appleLanguage) > -1) {
          return valueList
        }
      }

      return NativeApple2WebKitLanguageMap[defaultLanguage]
    } else if (getType === 'webkitCompatible') {
      var mapValue = null;
      var webLanguage = navigator.language || 'en';

      var inArray = function (value, array) {
        if (Array.prototype.indexOf) {
          return array.indexOf(value)
        } else {
          for (var i = 0; i < array.length; i++) {
            if (array[i] === value) { return i }
          }
          return -1
        }
      };

      for (var key in NativeApple2WebKitLanguageMap) {
        if (NativeApple2WebKitLanguageMap.hasOwnProperty(key)) {
          var languageArray = NativeApple2WebKitLanguageMap[key];
          if (inArray(webLanguage, languageArray) > -1) {
            mapValue = languageArray;
            break
          }
        }
      }

      return mapValue
    }

    return console.error('调用方式不正确，需要的参数为:Native2Webkit 或者webkitCompatible')
  }