当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript reporters.log_warn函数代码示例

本文整理汇总了TypeScript中@core/util/reporters.log_warn函数的典型用法代码示例。如果您正苦于以下问题:TypeScript log_warn函数的具体用法?TypeScript log_warn怎么用?TypeScript log_warn使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了log_warn函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: emit

    emit(signal, a?, b?, c?){
        var controllers = _collection[this.name],
            name = this.name,
            args = _Array_slice.call(arguments, 1);
        
        if (controllers == null) {
            //if DEBUG
            log_warn('Pipe.emit: No signals were bound to:', name);
            //endif
            return;
        }
        
        var i = controllers.length,
            called = false;

        while (--i !== -1) {
            var ctr = controllers[i];
            var slots = ctr.pipes[name];

            if (slots == null) 
                continue;
            
            var slot = slots[signal];
            if (slot != null) {
                slot.apply(ctr, args);
                called = true;
            }
        }

        // if DEBUG
        if (called === false)
            log_warn('Pipe `%s` has not slots for `%s`', name, signal);
        // endif
    }
开发者ID:atmajs,项目名称:MaskJS,代码行数:34,代码来源:pipes.ts

示例2: function

			domLib.fn[method] = function(template, model, ctr, ctx){
				if (this.length === 0) {
					//#if (DEBUG)
					log_warn('<jcompo> $.', method, '- no element was selected(found)');
					//#endif
					return this;
				}
				if (this.length > 1) {
					//#if (DEBUG)
					log_warn('<jcompo> $.', method, ' can insert only to one element. Fix is comming ...');
					//#endif
				}
				if (ctr == null) {
					ctr = index < 2
						? this.compo()
						: this.parent().compo()
						;
				}
				
				var isUnsafe = false;
				if (ctr == null) {
					ctr = {};
					isUnsafe = true;
				}
				
				
				if (ctr.components == null) {
					ctr.components = [];
				}
				
				var compos = ctr.components,
					i = compos.length,
					fragment = renderer_render(template, model, ctx, null, ctr);
				
				var self = this[jQ_Methods[index]](fragment),
					imax = compos.length;
				
				for (; i < imax; i++) {
					CompoSignals.signal.emitIn(compos[i], 'domInsert');
				}
				
				if (isUnsafe && imax !== 0) {
					// if DEBUG
					log_warn(
						'$.'
						, method
						, '- parent controller was not found in Elements DOM.'
						, 'This can lead to memory leaks.'
					);
					log_warn(
						'Specify the controller directly, via $.'
						, method
						, '(template[, model, controller, ctx])'
					);
					// endif
				}
				
				return self;
			};
开发者ID:atmajs,项目名称:MaskJS,代码行数:59,代码来源:jCompo.ts

示例3: _merge

function _merge(node, placeholders, tmplNode, clonedParent?) {
    if (node == null)
        return null;

    var fn;
    if (is_Array(node)) {
        fn = _mergeArray;
    } else {
        switch (node.type) {
            case dom_TEXTNODE:
                fn = _cloneTextNode;
                break;
            case dom_DECORATOR:
                fn = _cloneDecorator;
                break;
            case dom_NODE:
            case dom_STATEMENT:
                fn = _mergeNode;
                break;
            case dom_FRAGMENT:
                fn = _mergeFragment;
                break;
            case dom_COMPONENT:
                fn = _mergeComponent;
                break;
        }
    }
    if (fn !== void 0) {
        return fn(node, placeholders, tmplNode, clonedParent);
    }
    log_warn('Unknown type', node.type);
    return null;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:33,代码来源:merge.ts

示例4: interpolate_

function interpolate_(path, placeholders, node) {
    var index = path.indexOf('.');
    if (index === -1) {
        log_warn('Merge templates. Accessing node', path);
        return null;
    }
    var tagName = path.substring(0, index),
        id = tagName.substring(1),
        property = path.substring(index + 1),
        obj = null;

    if (node != null) {
        if (tagName === '@attr') {
            return interpolate_getAttr_(node, placeholders, property);
        }
        else if (tagName === '@counter') {
            return interpolate_getCounter_(property);
        }
        else if (tagName === node.tagName)
            obj = node;
    }

    if (obj == null)
        obj = placeholders.$getNode(id);

    if (obj == null) {
        //- log_error('Merge templates. Node not found', tagName);
        return null;
    }
    return obj_getProperty(obj, property);
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:31,代码来源:merge.ts

示例5: function

 register: function(id, nodes){
     if (id == null) {
         log_warn('`:template` must define the `id` attr');
         return;
     }
     cache_[id] = nodes;
 }
开发者ID:atmajs,项目名称:MaskJS,代码行数:7,代码来源:template.ts

示例6: mask_config

export function mask_config (a?, b?, c?) {
	var args = arguments,
		length = args.length
	if (length === 0) {
		return __cfg;
	}
	if (length === 1) {
		let x = args[0]
		if (is_Object(x)) {
			obj_extend(__cfg, x);
			listeners_emit('config', x);
			return;
		}
		if (is_String(x)) {
			return obj_getProperty(__cfg, x);
		}
	}
	if (length === 2) {
		var prop = args[0];
		if (obj_hasProperty(__cfg, prop) === false) {
			log_warn('Unknown configuration property', prop);
		}
		let x = {};
		obj_setProperty(x    , prop, args[1]);
		obj_setProperty(__cfg, prop, args[1]);
		listeners_emit('config', x);
		return;
	}
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:29,代码来源:config.ts

示例7: function

		resolveCompo: function(el, silent?){
			if (el == null)
				return null;
			
			var ownerId, id, compo;
			do {
				id = el.getAttribute('x-compo-id');
				if (id != null) {
					if (ownerId == null) {
						ownerId = id;
					}
					compo = _cache[id];
					if (compo != null) {
						compo = compo_find(compo, {
							key: 'ID',
							selector: ownerId,
							nextKey: 'components'
						});
						if (compo != null) 
							return compo;
					}
				}
				el = el.parentNode;
			}while(el != null && el.nodeType === 1);

			// if DEBUG
			ownerId && silent !== true && log_warn('No controller for ID', ownerId);
			// endif
			return null;
		},
开发者ID:atmajs,项目名称:MaskJS,代码行数:30,代码来源:anchor.ts

示例8: _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

示例9: function

 '$': function(compo, selector) {
     var r = domLib_find(compo.$, selector)
     //#if (DEBUG)
     if (r.length === 0)
         log_warn('<compo-selector> - element not found -', selector, compo);
     //#endif
     return r;
 },
开发者ID:atmajs,项目名称:MaskJS,代码行数:8,代码来源:CompoConfig.ts


注:本文中的@core/util/reporters.log_warn函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。