HN2new | past | comments | ask | show | jobs | submitlogin

Something like this could work, to some degree:

        a = {}
        a.valueOf = function() {
           var caller = arguments.callee.caller.toString();
           //parse the caller function, and return 
           //different values based on what comparison is being made. 
        }
But I think this is even worse than the getter on the global object.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: