本文整理汇总了TypeScript中@core/util/reporters.error_withNode函数的典型用法代码示例。如果您正苦于以下问题:TypeScript error_withNode函数的具体用法?TypeScript error_withNode怎么用?TypeScript error_withNode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了error_withNode函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: _wrapper_Fn
export function _wrapper_Fn(decoNode, deco, innerFn, target, key) {
if (is_Function(deco)) {
if (deco.length > 1) {
var descriptor = { value: innerFn };
var result = deco(target, key, descriptor);
if (result == null) {
if (target[key] !== innerFn) {
return target[key];
}
return descriptor.value;
}
if (result.value == null) {
error_withNode(
'Decorator should return value descriptor',
decoNode
);
return innerFn;
}
return result.value;
}
return deco(innerFn) || innerFn;
}
var beforeInvoke = deco.beforeInvoke,
afterInvoke = deco.afterInvoke;
if (beforeInvoke || afterInvoke) {
return function() {
var args = _Array_slice.call(arguments);
if (beforeInvoke != null) {
var overridenArgs = beforeInvoke.apply(this, args);
if (is_Array(overridenArgs)) {
args = overridenArgs;
}
}
var result = innerFn.apply(this, args);
if (afterInvoke != null) {
var overridenResult = afterInvoke.call(this, result);
if (overridenResult !== void 0) result = overridenResult;
}
return result;
};
}
error_withNode('Invalid function decorator', decoNode);
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:46,代码来源:wrappers.ts
示例2: _getDecorator
export function _getDecorator (decoNode, model, ctx, ctr) {
var expr = decoNode.expression,
deco = expression_eval(expr, _store, null, ctr);
if (deco == null) {
error_withNode('Decorator not resolved', decoNode);
return null;
}
if (expr.indexOf('(') === -1 && isFactory(deco)) {
return initialize(deco);
}
return deco;
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:13,代码来源:utils.ts
示例3: _wrapper_CompoBuilder
export function _wrapper_CompoBuilder (decoNode, deco, builderFn) {
let beforeRender, afterRender, decoCtx;
if (is_Function(deco)) {
beforeRender = deco;
} else if (is_Object(deco)) {
beforeRender = deco.beforeRender;
afterRender = deco.afterRender;
decoCtx = deco;
}
if (beforeRender || afterRender) {
return create(decoCtx, beforeRender, afterRender, builderFn);
}
error_withNode('Invalid node decorator', decoNode);
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:15,代码来源:wrappers.ts
示例4: _mergeNode
function _mergeNode(node, placeholders, tmplNode, clonedParent) {
var tagName = node.tagName;
if (tagName.charCodeAt(0) !== 64) {
// @
return _cloneNode(node, placeholders, tmplNode, clonedParent);
}
placeholders.$isEmpty = false;
var parentIsCompo = clonedParent && placeholders.$compos[clonedParent.tagName] != null;
if (parentIsCompo) {
var isSimpleNode = node.nodes == null || node.nodes.length === 0;
if (isSimpleNode === false) {
// Interpolate component slots
return _cloneNode(node, placeholders, tmplNode, clonedParent);
}
}
var id = node.attr.id;
if (tagName === tag_PLACEHOLDER && id == null) {
if (tmplNode != null) {
var tagName_ = tmplNode.tagName;
if (tagName_ != null && tmplNode.tagName.charCodeAt(0) === 64 /*@*/) {
return tmplNode.nodes
}
}
id = '$root';
placeholders.$extra = null;
}
if (tag_EACH === tagName) {
var arr = placeholders.$getNode(node.expression),
x;
if (arr == null) {
if (node.attr.optional == null) {
error_withNode('No template node: @' + node.expression, node);
}
return null;
}
if (is_Array(arr) === false) {
x = arr;
return _merge(
node.nodes
, _resolvePlaceholders(x.nodes, x.nodes, new Placeholders(placeholders))
, x
, clonedParent
);
}
var fragment = new Dom.Fragment,
imax = arr.length,
i = -1;
while (++i < imax) {
x = arr[i];
appendAny(fragment, _merge(
node.nodes
, _resolvePlaceholders(x, x, new Placeholders(placeholders))
, x
, clonedParent
));
}
return fragment;
}
if (tag_IF === tagName) {
var val = eval_(node.expression, placeholders, tmplNode);
return val
? _merge(node.nodes, placeholders, tmplNode, clonedParent)
: null
;
}
if (id == null)
id = tagName.substring(1);
var content = placeholders.$getNode(id, node.expression);
if (content == null) {
if (placeholders.opts.extending === true || parentIsCompo) {
return node;
}
return null;
}
if (content.parent)
_modifyParents(clonedParent, content.parent);
var contentNodes = content.nodes,
wrapperNode;
if (node.attr.as !== void 0) {
var tagName_ = node.attr.as;
wrapperNode = {
type: dom_NODE,
tagName: tagName_,
attr: _mergeAttr(node.attr, content.attr, placeholders, tmplNode),
parent: clonedParent,
nodes: contentNodes
};
wrapperNode.attr.as = null;
}
if (node.nodes == null) {
return _merge((wrapperNode || contentNodes), placeholders, tmplNode, clonedParent);
//.........这里部分代码省略.........
开发者ID:atmajs,项目名称:MaskJS,代码行数:101,代码来源:merge.ts
示例5: error_withNode
import_.loadImport(function(error) {
if (error) {
error_withNode(error, node);
}
done && done();
});
开发者ID:atmajs,项目名称:MaskJS,代码行数:6,代码来源:ModuleMask.ts
示例6: function
_store[key] = function() {
return new (mix.bind.apply(
mix,
[null].concat(_Array_slice.call(arguments))
))();
};
_store[key].isFactory = true;
return;
}
_store[key] = mix;
},
goToNode(nodes, start, imax) {
var i = start;
while (++i < imax && nodes[i].type === 16);
if (i === imax) {
error_withNode('No node to decorate', nodes[start]);
return i;
}
return i;
},
wrapMethodNode(decorators, node, model, ctx, ctr) {
if (node.fn) return node.fn;
var fn = Methods.compileForNode(node, model, ctr);
return (node.fn = this.wrapMethod(
decorators,
fn,
node,
'fn',
model,
ctx,
ctr
开发者ID:atmajs,项目名称:MaskJS,代码行数:31,代码来源:exports.ts
注:本文中的@core/util/reporters.error_withNode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论