當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript exports.expression_evalStatements函數代碼示例

本文整理匯總了TypeScript中@project/expression/src/exports.expression_evalStatements函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript expression_evalStatements函數的具體用法?TypeScript expression_evalStatements怎麽用?TypeScript expression_evalStatements使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了expression_evalStatements函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: _modelArgsBinding

function _modelArgsBinding(args: any[], expr, model, ctx, ctr) {
    var arr = null;
    if (expr == null) {
        var i = args.length;
        arr = new Array(i);
        while (--i > -1) {
            arr[i] = expression_eval(args[i].name, model, ctx, ctr);
        }
    } else {
        arr = expression_evalStatements(expr, model, ctx, ctr);
    }
    var out = {},
        arrMax = arr.length,
        argsMax = args.length,
        i = -1;
    while (++i < arrMax && i < argsMax) {
        var val = arr[i];
        if (val == null) {
            var type = args[i].type;
            if (type != null) {
                var Type = type;
                if (typeof type === 'string') {
                    Type = expression_eval(type, model, ctx, ctr);
                    if (Type == null) {
                        error_withCompo(type + ' was not resolved', ctr);
                    } else {
                        val = Di.resolve(Type);
                    }
                }
            }
        }
        out[args[i].name] = val;
    }
    return out;
}
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:35,代碼來源:compo_meta.ts

示例2: function

    constructor: function(compo, expression) {
        this.error = null;
        this.exports = [];
        this.onResolve = this.onResolve.bind(this);
        this.onReject = this.onReject.bind(this);
                
        var arr = expression_evalStatements(expression, compo.model, null, compo);
        var imax = arr.length,
            i = -1;

        this.await_ = imax;
        while(++i < imax) {
            var x = arr[i];
            if (x == null || is_Function(x.then) === false) {
                this.await_--;
                this.exports.push(x);
                continue;
            }

            x.then(this.onResolve, this.onReject);				
        }
        if (this.await_ === 0) {
            this.resolve(this.exports);
        }
    },
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:25,代碼來源:await.ts

示例3: call

	function call (method, expr, model, ctr, cb) {
		var arr = expression_evalStatements(expr, model, null, ctr);
		var observable = arr.shift();
		if (observable == null || observable[method] == null) {
			log_error('Method is undefined on observable: ' + method);
			return;
		}
		arr.push(cb);
		observable[method].apply(observable, arr);
	}
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:10,代碼來源:EventEmitterBinder.ts

示例4: function

 return function(event) {
     var args;
     if (arguments.length > 1) {
         args = _Array_slice.call(arguments, 1); 
     }
     if (expr != null) {
         var arr = expression_evalStatements(expr, ctr.model, null, ctr);
         args = args == null ? arr : args.concat(arr);
     }
     _fire(ctr, slot, event, args, -1);
 };
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:11,代碼來源:attributes.ts

示例5: call

	on: function call (expr, model, ctr, cb) {
		var arr = expression_evalStatements(expr, model, null, ctr);

		var stream = arr.shift();
		if (stream == null || stream.subscribe == null) {
			error_withCompo('Subscribe method is undefined on RxObservable', ctr);
			return;
		}
		arr.push(cb);
		this.stream = stream.subscribe.apply(stream, arr);
	},
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:11,代碼來源:RxBinder.ts

示例6: function

		var Wrapped = function (node, model, ctx, el, parent) {
			var args;
			if (node.expression != null) {
				args = expression_evalStatements(node.expression, model, ctx, parent, node);
			}
			if (types != null) {
				if (args == null) args = new Array(types.length);
				for (var i = 0; i < types.length; i++) {
					if (types[i] === null || args[i] != null) continue;
					args[i] = _di.resolve(types[i]);
				}
			}
			Ctor.apply(this, args);
		};
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:14,代碼來源:Di.ts

示例7: render

import { custom_Statements } from '@core/custom/exports';
import { expression_evalStatements } from '@project/expression/src/exports';
import { customTag_register } from '@core/custom/exports';


custom_Statements['log'] = {
    render (node, model, ctx, container, controller) {
        var arr = expression_evalStatements(node.expression, model, ctx, controller);
        arr.unshift('Mask::Log');
        console.log.apply(console, arr);
    }
};
customTag_register('debugger', {
    render (model, ctx, container, compo) {
        debugger;
    }
});
customTag_register(':utest', class {
    $: JQuery
    render (model, ctx, container) {
        if (container.nodeType === Node.DOCUMENT_FRAGMENT_NODE)
            container = container.childNodes;
        this.$ = $(container);
    }
});
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:25,代碼來源:debug.ts

示例8: function

	custom_Tags['import:cfg'] = function(node, model, ctx, el, ctr){
		var args = expression_evalStatements(node.expression, model, ctx, ctr);
		m_cfg.apply(null, args);
	};
開發者ID:atmajs,項目名稱:MaskJS,代碼行數:4,代碼來源:components.ts


注:本文中的@project/expression/src/exports.expression_evalStatements函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。