Sha256: edbe7ad170d05f426c948a4f9d9109691877382a66d5d5ea94e7184449536d40

Contents?: true

Size: 690 Bytes

Versions: 132

Compression:

Stored size: 690 Bytes

Contents

/**@constructor*/
function Reflection(obj) {
	this.obj = obj;
}

Reflection.prototype.getConstructorName = function() {
	if (this.obj.constructor.name) return this.obj.constructor.name;
	var src = this.obj.constructor.toSource();
	var name = src.substring(name.indexOf("function")+8, src.indexOf('(')).replace(/ /g,'');
	return name;
}

Reflection.prototype.getMethod = function(name) {
	for (var p in this.obj) {
		if (p == name && typeof(this.obj[p]) == "function") return this.obj[p];
	}
	return null;
}

Reflection.prototype.getParameterNames = function() {
	var src = this.obj.toSource();
	src = src.substring(
		src.indexOf("(", 8)+1, src.indexOf(")")
	);
	return src.split(/, ?/);
}

Version data entries

132 entries across 131 versions & 14 rubygems

Version Path
sproutcore-1.0.1025 vendor/jsdoc/app/frame/Reflection.js
sproutcore-1.0.1024 vendor/jsdoc/app/frame/Reflection.js
sproutcore-1.0.1009 vendor/jsdoc/app/frame/Reflection.js
sproutcore-1.0.1008 vendor/jsdoc/app/frame/Reflection.js
jsdoc-toolkit-0.2.0 src/jsdoc-toolkit/jsdoc-toolkit/app/frame/Reflection.js
jsdoc-toolkit-0.1.4 src/jsdoc-toolkit/jsdoc-toolkit/app/frame/Reflection.js
xpcomcore-rubygem-0.3.2 xpcomcore/etc/jsdoc-toolkit/app/frame/Reflection.js
jsdoc-toolkit-0.1.3 src/jsdoc-toolkit/jsdoc-toolkit/app/frame/Reflection.js
jsdoc-toolkit-0.1.2 src/jsdoc-toolkit/jsdoc-toolkit/app/frame/Reflection.js
xultestrunner-0.2.9 xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Reflection.js
xultestrunner-0.2.8 xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Reflection.js
sproutcore-1.0.1003 vendor/jsdoc/app/frame/Reflection.js