How to refer to the current prototype of a class.
/#!/JoePea
joe at trusktr.io
Sun Aug 7 05:20:50 UTC 2016
On Sun, Jul 31, 2016 at 4:15 AM, Claude Pache <claude.pache at gmail.com>
wrote:
> What is the issue with just `Foo.prototype`?
It means it is subject to renaming (therefore mistakes) when the class
name needs to be changed. Also, consider how lengthy it is to access a
getter or setter:
```js
Object.getOwnPropertyDescriptor(Foo.prototype,
'someSetter').set.call(this, value)
```
vs
```js
current.someSetter = value
```
Having such a keyword for convenience may also encourage class designers to
avoid the [Fragile Base Class Problem](
https://www.cs.cmu.edu/~aldrich/papers/selective-open-recursion.pdf).
*/#!/*JoePea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160806/77acb9b1/attachment.html>
More information about the es-discuss
mailing list