I see it as it should semantically be identical to this, short a duplicate
module request avoided:
```js
// Proposed
import {x, y} as foo from "mod"
// Desugared
import * as foo from "mod"
import {x, y} from "mod"
```
(This includes the implication `x`/`foo.x` and `y`/`foo.y` are equivalent.)
O
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
impo
@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
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
if you `import {x} from "foo"` and `x` changes in foo, then `x` reflects
changes in the module that imported it.
if you `import {x} as foo from "foo"` I'd expect the same and my answer was
making it possible, without using Proxies, right?
not sure why you're fully skipping my proposed solution her
inline
> On Dec 14, 2017, at 2:29 PM, Darien Valentine wrote:
>
> 1. (Caching of same-subset namespace import) My gut feeling was that the
> simplest thing to do would be to treat `import { x, y } as foo from 'foo';`
> as _always_ creating a new MNSEO or — more likely? — not an MNSEO directly,
I see the following:
```js
import { x, y } as foo1 from "foo";
```
as the pseudo equivalent of:
```js
import {x, y} from "foo";
const foo1 = {
// live bindings survive
get x() { return x; },
get y() { return y; }
};
// but x and y never happened
// (pseudo-operation)
delete scope reference
1. (Caching of same-subset namespace import) My gut feeling was that the
simplest thing to do would be to treat `import { x, y } as foo from 'foo';`
as _always_ creating a new MNSEO or — more likely? — not an MNSEO directly,
but a proxy of it whose only job is to filter access. That is, internally
Ok, fair enough! grammar wise, it doesn’t seem impossible since we already have
`* as ns`. We knew about the possibility of doing folding and tree shaking, but
there was nothing practical when module syntax was approved, and at that point,
importing a namespace was probably sufficient, but not a
Hi all
So many years ago on the sla.ckers forums Yosuke Hasegawa posted
non-alphanumeric JavaScript. We then worked together to find out the
smallest possible charset required to execute non-alphanumeric JavaScript.
We all broke the wall multiple times and Mario Heiderich found the
character limit
9 matches
Mail list logo