本文整理汇总了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;未经允许,请勿转载。 |
请发表评论