I've just tried monkey patching all the scenarios I've described/mentioned
and it works right away.

// x.js
export let x = 1;
setTimeout(() => x = 2, 2000);

// module.js
import {x} from './x.js';
const obj = Object.defineProperty({}, 'x', {get() { return x; }});
export {x, obj};

// index.js
import {x, obj} from './module.js';
console.log(x, obj.x);
setTimeout(() => console.log(x, obj.x), 3000);

I see 1, 1 and then 2, 2 without using proxies or exotic objects.

`{a, b, c} as obj` should really just avoid `a`, `b`, `c` scope pollution
and create those accessors in the `obj` constant object reference.

Regards


On Thu, Dec 14, 2017 at 5:55 PM, Darien Valentine <[email protected]>
wrote:

> @Andrea I think we are thinking along the same lines. I meant proxy with a
> lowercase p — what you described fits the bill.
>
> _______________________________________________
> 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

Reply via email to