mirror of
				https://github.com/flynx/actions.js.git
				synced 2025-10-31 19:30:08 +00:00 
			
		
		
		
	bugfix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									716e33ab8d
								
							
						
					
					
						commit
						1316c9c5c3
					
				
							
								
								
									
										52
									
								
								actions.js
									
									
									
									
									
								
							
							
						
						
									
										52
									
								
								actions.js
									
									
									
									
									
								
							| @ -1155,26 +1155,50 @@ module.MetaActions = { | |||||||
| 	chainCall: function(outer, inner){ | 	chainCall: function(outer, inner){ | ||||||
| 		return this[outer].chainApply(this, inner, args2array(arguments).slice(2)) }, | 		return this[outer].chainApply(this, inner, args2array(arguments).slice(2)) }, | ||||||
| 
 | 
 | ||||||
|  | 	// Get action/method resolution order...
 | ||||||
|  | 	//
 | ||||||
|  | 	// 	List mixin tags...
 | ||||||
|  | 	// 	.mro()
 | ||||||
|  | 	// 	.mro('tag')
 | ||||||
|  | 	// 		-> tags
 | ||||||
|  | 	//
 | ||||||
|  | 	// 	List mixin objects...
 | ||||||
|  | 	// 	.mro('object')
 | ||||||
|  | 	// 		-> objects
 | ||||||
|  | 	//
 | ||||||
|  | 	// 	List mixin tag-object pairs...
 | ||||||
|  | 	// 	.mro('item')
 | ||||||
|  | 	// 		-> items
 | ||||||
|  | 	//
 | ||||||
|  | 	mro: function(target){ | ||||||
|  | 		target = target || 'tag' | ||||||
|  | 		var res = [] | ||||||
|  | 		var cur = this | ||||||
|  | 		while(cur != null){ | ||||||
|  | 			res.push(target == 'tag' ? cur.__mixin_tag | ||||||
|  | 				: target == 'object' ? cur | ||||||
|  | 				: [cur.__mixin_tag, cur]) | ||||||
|  | 			// go to next item in chain...
 | ||||||
|  | 			cur = cur.__proto__ | ||||||
|  | 		} | ||||||
|  | 		return res | ||||||
|  | 	}, | ||||||
|  | 	 | ||||||
| 	// Get mixin object in inheritance chain...
 | 	// Get mixin object in inheritance chain...
 | ||||||
| 	//
 | 	//
 | ||||||
| 	// NOTE: if pre is true this will return the chain item before the 
 | 	// NOTE: if pre is true this will return the chain item before the 
 | ||||||
| 	// 		mixin, this is useful, for example, to remove mixins, see 
 | 	// 		mixin, this is useful, for example, to remove mixins, see 
 | ||||||
| 	// 		.mixout(..) for an example...
 | 	// 		.mixout(..) for an example...
 | ||||||
| 	getMixin: function(from, pre){ | 	getMixin: function(from, pre){ | ||||||
| 		var cur = this | 		var mro = this.mro('object') | ||||||
| 		var proto = this.__proto__ | 		var res = (pre ? mro.slice(1) : mro) | ||||||
| 		while(proto != null){ | 			.filter(function(e){  | ||||||
| 			// we have a hit...
 | 				return e.__mixin_tag == from  | ||||||
| 			if(proto.hasOwnProperty('__mixin_source')  | 					|| e.__mixin_source === from }) | ||||||
| 					&& (proto.__mixin_source === from | 			.shift() | ||||||
| 						|| proto.__mixin_tag == from)){ | 		return pre ? | ||||||
| 				return pre ? cur : proto | 			mro[mro.indexOf(res)-1] | ||||||
| 			} | 			: res | ||||||
| 			// go to next item in chain...
 |  | ||||||
| 			cur = proto |  | ||||||
| 			proto = cur.__proto__ |  | ||||||
| 		} |  | ||||||
| 		return null |  | ||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
| 	// Mixin a set of actions into this...
 | 	// Mixin a set of actions into this...
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user