this.constructor.prototype.baz
On 31 Jul 2016 3:03 a.m., "/#!/JoePea" <[email protected]> wrote:
> Currently we use
>
> ```js
> class Foo {
>
> bar() {
>
> // we want the current prototype's (HomeObject's?) `baz` method, not
> the leafmost prototype's (this') `baz` method.
> Foo.prototype.baz()
>
> }
>
> baz() {
> // ..
> }
>
> }
> ```
>
> What about a shorthand keyword like `current` for the "current prototype"?
>
> ```js
> class Foo {
>
> bar() {
>
> // we want the current prototype's (HomeObject's?) `baz` method, not
> the leafmost prototype's (this') `baz` method.
> current.baz()
>
> }
>
> baz() {
> // ..
> }
>
> }
> ```
>
> What about `prototype`, because that word is, afterall, owned by
> JavaScript (though more likely to break code than `current`).
>
> ```js
> class Foo {
>
> bar() {
>
> // we want the current prototype's (HomeObject's?) `baz` method, not
> the leafmost prototype's (this') `baz` method.
> prototype.baz()
>
> }
>
> baz() {
> // ..
> }
>
> }
> ```
>
> Or, since `HomeObject` is a thing, maybe a `home` keyword would be
> intuitive, although that is also more likely to break existing code than
> `current`?
>
> ```js
> class Foo {
>
> bar() {
>
> // we want the current prototype's (HomeObject's?) `baz` method, not
> the leafmost prototype's (this') `baz` method.
> home.baz()
>
> }
>
> baz() {
> // ..
> }
>
> }
> ```
>
> Or a symbol?
>
> ```js
> class Foo {
>
> bar() {
>
> // we want the current prototype's (HomeObject's?) `baz` method, not
> the leafmost prototype's (this') `baz` method.
> #.baz()
>
> }
>
> baz() {
> // ..
> }
>
> }
> ```
>
> */#!/*JoePea
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss