/**返回指定对象的完全限定名 */
static getQualifiedClassName(value):string {
var type = typeof value;
if (!value || (type != "object" && !value.prototype)) {
return type;
}
var prototype = value.prototype ? value.prototype : Object.getPrototypeOf(value);
if (prototype.hasOwnProperty("__class__")) {
return prototype["__class__"];
}
var constructorString = prototype.constructor.toString().trim();
var index = constructorString.indexOf("(");
var className = constructorString.substring(9, index);
Object.defineProperty(prototype, "__class__", {
value: className,
enumerable: false,
writable: true
});
return className;
}
不用些谢 白鹭拷贝过来的代码