Do we really need the [[HasOwnProperty]] internal method and hasOwn trap
brendan at mozilla.org
Wed Nov 14 02:34:29 PST 2012
Tom Van Cutsem wrote:
> it's an old problem in OO frameworks in general, whose documentation
> may state: "if you subclass class C, and you override method "foo",
> make sure you also override method "bar" consistently!". I'm sure
> you've had way more practical experience with exactly this issue in
> developing OO frameworks than I ever have :-)
Agreed. Some OO languages preclude super calls except to the same-named
method as the one making the call, because they want all peer method
calls to be virtual in the C++ sense. This goes too far in my view,
though. Sometimes when calling a super-method you need to call a related
super-peer-method. ES6 classes with super allow this.
There's no silver bullet for this footgun ;-).
More information about the es-discuss