Boolean objects in conditionals

Peter Michaux petermichaux at gmail.com
Fri Nov 28 21:05:23 PST 2008


On Fri, Nov 28, 2008 at 8:43 PM, Brendan Eich <brendan at mozilla.com> wrote:

> class C(x,y) {
>    ...
>    private self {
>        function m1(a,b) { /* use "self" to denote receiver */ ... }
>        function m2(c)   { /* ditto */ ... }
>        ...
>    }
> }

Almost may as well just always start the class with a first line like
the following.

class C(x,y) {
   var self = this;
   function m1(a,b) { /* use "self" to denote receiver */ ... }
   function m2(c)   { /* ditto */ ... }
}

It gives non-dynamically bound "this" access which was on of the
issues in the wiki page. Probably not enough boiler plate to warrant
sugar.

Peter


More information about the Es-discuss mailing list