IcarusSO / ZNOW

3 stars 1 forks source link

Get instance class name #2

Open peterdenev opened 9 years ago

peterdenev commented 9 years ago

It will be great if there is a way to get the class name from instance. Now it returns "Function".

IcarusSO commented 9 years ago

Hi, it may not be possible to add this feature because a class may be assigned to different variables in different module. For example, //ClassA.js var ClassA = Class({ ... }) module.exports=ClassA;

//ModuleB.js var ClassA1=require("./ClassA");

//MoudleC.js var ClassA2=require("./ClassA");

And, you can add the name as a static property to a Class.

By the way, do you use ZNOW in any project? What improvements do you think should be added? You may contact me via email: icarus.so.ch@gmail.com