IcarusSO / ZNOW

3 stars 1 forks source link

add constructorName #3

Open peterdenev opened 9 years ago

peterdenev commented 9 years ago

If a constructor have a name:

var Person=Class({
 init:function Person(){
 }
})

Class name can be get:

Person.constructorName
//or
var p = new Person();
p.class.constructorName

P.S. not the best way but works. N.B! It gets the "init", "_init", "$init" methods, but didn't look up for inherit data

peterdenev commented 9 years ago

As the commits say:

(Check out my repo for TypeValidation that can be used with ZNOW too)