Sha256: 9da9d759eb9540ea836cc472b620e6889e49ed6c927ef6e114ed19e951e6200e

Contents?: true

Size: 1.25 KB

Versions: 10

Compression:

Stored size: 1.25 KB

Contents

dojo.provide("dojox.lang.aspect.cflow");


(function(){
	var aop = dojox.lang.aspect;
	
	aop.cflow = function(/*Object*/ instance, /*String|RegExp|Array?*/ method){
		// summary:
		//		Returns true if the context stack contains a context for a given
		//		instance that satisfies a given method name criteria.
		//
		// instance:
		//		An instance to be matched. If null, any context will be examined.
		//		Otherwise the context should belong to this instance.
		//
		// method:
		//		An optional pattern to be matched against a method name. Can be a string,
		//		a RegExp object or an array of strings and RegExp objects.
		//		If it is omitted, any name will satisfy the criteria.
	
		if(arguments.length > 1 && !(method instanceof Array)){
			method = [method];
		}
	
		var contextStack = aop.getContextStack();
		for(var i = contextStack.length - 1; i >= 0; --i){
			var c = contextStack[i];
			// check if instance matches
			if(instance && c.instance != instance){ continue; }
			if(!method){ return true; }
			var n = c.joinPoint.targetName;
			for(var j = method.length - 1; j >= 0; --j){
				var m = method[j];
				if(m instanceof RegExp){
					if(m.test(n)){ return true; }
				}else{
					if(n == m){ return true; }
				}
			}
		}
		return false;	// Boolean
	};
})();

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
dojo_src-1.5.0 dojo/dojox/lang/aspect/cflow.js
dojo_src-1.4.3 dojo/dojox/lang/aspect/cflow.js
dojo_src-1.4.102 dojo/dojox/lang/aspect/cflow.js
dojo-pkg-1.132.0 data/dojo-release-1.3.2-src/dojox/lang/aspect/cflow.js
dojo-pkg-1.120.0 data/dojo-release-1.2.0-src/dojox/lang/aspect/cflow.js
dojo-pkg-1.121.0 data/dojo-release-1.2.1-src/dojox/lang/aspect/cflow.js
dojo-pkg-1.122.0 data/dojo-release-1.2.2-src/dojox/lang/aspect/cflow.js
dojo-pkg-1.123.0 data/dojo-release-1.2.3-src/dojox/lang/aspect/cflow.js
dojo-pkg-1.130.0 data/dojo-release-1.3.0-src/dojox/lang/aspect/cflow.js
dojo-pkg-1.131.0 data/dojo-release-1.3.1-src/dojox/lang/aspect/cflow.js