Brendan Eich wrote:
And _the_real_foo should be expanded:
{
private foo;
...
}
desugars to
{
const foo = Name.create("foo");
...
}
with Name.create imported appropriately.
No, I though more in lines of:
// singleton code, in module level / program level
// generated from all private occurences:
const __prvTable__ = Name.create();
// __prvTable__ being hardwired somehow so it does not clash
// and of course hidden from user
@__prvTable__ = [
Name.create(),
Name.create(),
... // n times when n is number of privates
];
// and the bocks desugared to
{
const foo = module.@__prvTable__[42];
// module.@__prvTable__ is just a hint for
// "somehow, get to the private table"
// it is up to implementation
// 42 is just the example index
...
}
with Name.create imported appropriately.
/be
Herby
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss