On Friday, January 31, 2014 8:10 PM, Calvin Metcalf <[email protected]> 
wrote:

what I'm talking about would be sugar for something functionally equivalent to:
```js
import 'bar' as ___temp1;
import 'baz' as ___temp2;
var foo = Math.random() > 0.5 ? ___temp1 :___temp2;
```


I think it's good that imports are not expressions. It makes it a lot easier to 
analyze them statically.

These use cases are probably better solved at the Loader level. If I understood 
the spec correctly, If you have modules that you want to load conditionally you 
can set up a `normalize` hook that changes which module is actually loaded.

System.normalize = function (name) {
  if (name === 'bar' && Math.random() > 0.5') {
    return 'baz'
  }
  return name;
};

Juan
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to