本文整理汇总了TypeScript中@core/util/reporters.log_error函数的典型用法代码示例。如果您正苦于以下问题:TypeScript log_error函数的具体用法?TypeScript log_error怎么用?TypeScript log_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log_error函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: _handleDefinition
function _handleDefinition (el, ctr, definition, asEvent, isSlot) {
var match = rgx.exec(definition);
if (match == null) {
log_error('Signal definition is not resolved', definition, 'The pattern is: (source((sourceArg))?:)?signal((expression))?');
return null;
}
var source = match[2],
sourceArg = match[4],
signal = match[5],
signalExpr = match[7];
if (asEvent != null) {
sourceArg = source;
source = asEvent;
}
var fn = _createListener(ctr, signal, signalExpr);
if (!source) {
log_error('Signal: Eventname is not set', definition);
return null;
}
if (!fn) {
log_warn('Slot not found:', signal);
return null;
}
if (isSlot) {
compo_attach(ctr, 'slots.' + source, fn);
return;
}
dom_addEventListener(el, source, fn, sourceArg, ctr);
return signal;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:33,代码来源:attributes.ts
示例2: function
render: function(node, model, ctx, container, ctr, children){
var run = expression_eval,
str = node.expression,
repeat = str.split('..'),
start = + run(repeat[0] || '', model, ctx, ctr),
end = + run(repeat[1] || '', model, ctx, ctr);
if (start !== start || end !== end) {
log_error('Repeat attribute(from..to) invalid', str);
return;
}
var nodes = node.nodes;
var arr = [];
var i = start - 1;
while (++i < end) {
arr.push(compo_init(
'repeat::item',
nodes,
model,
i,
container,
ctr
));
}
var els = [];
builder_build(arr, model, ctx, container, ctr, els);
arr_pushMany(children, els);
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:30,代码来源:repeat.ts
示例3: function
InterpolationModel.prototype.process = function(model, ctx, el, ctr, name, type, node){
if (this.prop != null) {
return obj_getPropertyEx(this.prop, model, ctx, ctr);
}
var expr = this.expr,
index = expr.indexOf(':'),
util;
if (index !== -1) {
if (index === 0) {
expr = expr.substring(index + 1);
}
else {
var match = rgx_UTIL.exec(expr);
if (match != null) {
util = match[1];
expr = expr.substring(index + 1);
}
}
}
if (util == null || util === '') {
util = 'expression';
}
var fn = custom_Utils[util];
if (fn == null) {
log_error('Undefined custom util:', util);
return null;
}
return fn(expr, model, ctx, el, ctr, name, type, node);
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:30,代码来源:interpolation.ts
示例4: compo_extends
function compo_extends(extends_, model, ctr) {
var args = [];
if (extends_ == null)
return args;
var imax = extends_.length,
i = -1,
await = 0, x;
while( ++i < imax ){
x = extends_[i];
if (x.compo) {
var compo = customTag_get(x.compo, ctr);
if (compo != null) {
args.unshift(compo);
continue;
}
var obj = expression_eval(x.compo, model, null, ctr);
if (obj != null) {
args.unshift(obj);
continue;
}
log_error('Nor component, nor scoped data is resolved:', x.compo);
continue;
}
}
return args;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:28,代码来源:Define.ts
示例5: signal_parse
export function signal_parse (str, isPiped, defaultType) {
var signals = str.split(';'),
set = [],
i = 0,
imax = signals.length,
x,
signalName, type,
signal;
for (; i < imax; i++) {
x = signals[i].split(':');
if (x.length !== 1 && x.length !== 2) {
log_error('Too much ":" in a signal def.', signals[i]);
continue;
}
type = x.length === 2 ? x[0] : defaultType;
signalName = x[x.length === 2 ? 1 : 0];
signal = signal_create(signalName.trim(), type, isPiped);
if (signal != null) {
set.push(signal);
}
}
return set;
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:31,代码来源:signal.ts
示例6: function
initValidators: function() {
var attr = this.attr,
message = this.attr.message,
isDefault = message == null
if (isDefault) {
message = 'Invalid value of `' + this.attr.value + '`';
}
for (var key in attr) {
switch (key) {
case 'message':
case 'value':
case 'getter':
case 'silent':
continue;
}
if (key in Validators === false) {
log_error('Unknown Validator:', key, this);
continue;
}
var str = isDefault ? (message + ' Validation: `' + key + '`') : message
var fn = ValidatorProvider.getFnByName(key, attr[key], str);
if (fn != null) {
this.validators.push(fn);
}
}
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:27,代码来源:validate.ts
示例7: function
renderStart: function() {
var id = this.attr.id;
if (id == null) {
log_error('`:import` shoud reference the template via id attr')
return;
}
this.nodes = Templates.resolve(this, id);
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:8,代码来源:template.ts
示例8: _resolvePlaceholders
function _resolvePlaceholders(root, node, placeholders) {
if (node == null)
return placeholders;
if (is_Array(node)) {
var imax = node.length,
i = -1;
while (++i < imax) {
_resolvePlaceholders(node === root ? node[i] : root, node[i], placeholders);
}
return placeholders;
}
var type = node.type;
if (type === dom_TEXTNODE)
return placeholders;
if (type === dom_NODE) {
var tagName = node.tagName;
if (tagName != null && tagName.charCodeAt(0) === 64) {
// @
placeholders.$count++;
var id = tagName.substring(1);
// if DEBUG
if (RESERVED.indexOf(' ' + id + ' ') !== -1)
log_error('MaskMerge. Reserved Name', id);
// endif
var x = {
tagName: node.tagName,
parent: _getParentModifiers(root, node),
nodes: node.nodes,
attr: node.attr,
expression: node.expression,
type: node.type
};
if (placeholders[id] == null) {
placeholders[id] = x;
} else {
var current = placeholders[id];
if (is_Array(current)) {
current.push(x);
}
else {
placeholders[id] = [current, x];
}
}
return placeholders;
}
}
var count = placeholders.$count;
var out = _resolvePlaceholders(root, node.nodes, placeholders);
if (root === node && count === placeholders.$count) {
placeholders.$extra.push(root);
}
return out;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:57,代码来源:merge.ts
示例9: parser_setInterpolationQuotes
export function parser_setInterpolationQuotes (start, end) {
if (!start || start.length !== 2) {
log_error('Interpolation Start must contain 2 Characters');
return;
}
if (!end || end.length !== 1) {
log_error('Interpolation End must be of 1 Character');
return;
}
interp_code_START = start.charCodeAt(0);
interp_code_OPEN = start.charCodeAt(1);
interp_code_CLOSE = end.charCodeAt(0);
interp_START = start[0];
interp_OPEN = start[1];
interp_CLOSE = end;
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:18,代码来源:const.ts
示例10: 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
注:本文中的@core/util/reporters.log_error函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论