On Mar 12, 2009, at 2:25 PM, Tobie Langel wrote:
Could we possibly imagine having a non-[[Writable]] and non- [[Configurable]] 'name' property of built-in constructors whose value would be [[Class]] ?
So a string-valued property, e.g. f.constructor.name === "Function" for function f(){}, d.constructor.name === "Date" for (d = new Date), etc.?
Works for me, already implemented in SpiderMonkey. Note constructor being writable and configurable as I mentioned in reply to Tucker just now. If we want to avoid that hazard, we would need a separate, optionally locked-down method, say Object.getClassName(o).
/be
_______________________________________________ Es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

