On Tue, May 22, 2012 at 11:16 AM, Luke Hoban <[email protected]> wrote:
> The code above would be rewritten:
>
> class C(public x) {
> public method() {
> return this.x;
> }
> }
But also,
class C(x) {
var y = 42;
public method() {
return x + y;
}
}
This can be solved by treating all variables in the class body and the
constructor params as "private" instance properties and compile it to
something like:
import {Name} from "@name";
const _x = new Name;
const _y = new Name;
class C(x) {
this[_x] = x;
var y = 42;
this[_y] = y;
public method() {
return this[_x] + this[_y];
}
}
This might be too magical and confusing though.
--
erik
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss