is there a way to inject privileged methods after an object is constructed?

Posted by patrickgamer on Stack Overflow See other posts from Stack Overflow or by patrickgamer
Published on 2012-04-04T22:57:44Z Indexed on 2012/04/04 23:29 UTC
Read the original article Hit count: 122

I'm trying to write fully automated unit tests in JavaScript and I'm looking for a way to read some private variables in various JS functions. I thought I recalled a way to inject privileged members into a function/object (and found an overwhelming occurrence of "no such thing as private in JS") and yet I can't find any resources indicating how.

I'm trying to read through the properties of .prototype but if there's a way, someone out here would know where to direct me faster than I'd find on my own.

Thanks

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about private-members