2 function Reflection(obj
) {
6 Reflection
.prototype.getConstructorName
= function() {
7 if (this.obj
.constructor
.name
) return this.obj
.constructor
.name
;
8 var src
= this.obj
.constructor
.toSource();
9 var name
= src
.substring(name
.indexOf("function")+8, src
.indexOf('(')).replace(/ /g,'');
13 Reflection
.prototype.getMethod
= function(name
) {
14 for (var p
in this.obj
) {
15 if (p
== name
&& typeof(this.obj
[p
]) == "function") return this.obj
[p
];
20 Reflection
.prototype.getParameterNames
= function() {
21 var src
= this.obj
.toSource();
23 src
.indexOf("(", 8)+1, src
.indexOf(")")
25 return src
.split(/, ?/);