Working circular

The default export was intended for cases where a single thing needed to be
exported, doing both misses the point.
On Jul 3, 2014 5:45 PM, "Guy Bedford" <notifications@github.com> wrote:

> In lib/evaluate.js:
>
> > +  // this can also be done with VM or something cleaner
> > +  scopedEval.call(global, global, localRequire, localModule, record.exports, record.address, record.dirname);
> > +}
> > +
> > +function ourRequire(name, loader) {
> > +  // if in the side table
> > +  if (sidetable.has(name)) {
> > +    var record = sidetable.get(name);
> > +    evaluate(name, loader);
> > +    return record.exports;
> > +  }
> > +
> > +  if (loader.has(name)) {
> > +    var mod = loader.get(name);
> > +    if ('default' in mod) {
> > +      return mod.default;
>
> The problem with this approach is you miss functionality. Consider -
>
> export var a = 'something';export function default() {
>   // this is the default}
>
> Now in CommonJS we do:
>
> var fn = require('es6module');fn(); // works
> // but how do we access the "a" export?
>
> So I'm not sure this is a good option.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/calvinmetcalf/es6-translate/pull/10/files#r14539500>.
>