class sugar: static inheritance

Kam Kasravi kamkasravi at yahoo.com
Wed Jun 8 09:44:32 PDT 2011


Mark Miller wrote
> Actually, it isn't another topic. It's why Kam's GilaMonster cannot see Monster's "health". "private" means "private to the class", not "private to the class and subclasses". "protected" would mean the second, and no, I don't think it's inevitable. 
> 

Aren't there also motivations related to covert channels especially given javascript's call and apply where any object should not have the ability to discern what private fields exist within an instance? This may be preventable using the meta attributes on property descriptors, but it seems like private should not 'leak' even to subclasses - per Brendan's earlier statements. I imagine Mark can or has written volumes on this, but probing a subclass of 'CreditCard' for the existence of private instance variables or static class declarations would seem to enable an attack vector and violate the class proposal objective of 
Strong encapsulation in order to support defensiveness and security.

In other words it's seems like uses cases related to private instance as well as private class (ie static private) are reasonable and at least as important as protected. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110608/d9bdf657/attachment-0001.html>


More information about the es-discuss mailing list