Written Proposal for "package" Keyword for ES20XX Imports

Logan Smyth loganfsmyth at gmail.com
Wed Feb 22 18:18:12 UTC 2017


> What does the *spec* say should happen in that situation?

It would be a TDZ error, rather than `undefined`, in a real implementation
of block scoping + ES6 modules. The ordering still means that `A` won't
exist when `class B extends A` runs.

On Wed, Feb 22, 2017 at 10:00 AM, T.J. Crowder <
tj.crowder at farsightsoftware.com> wrote:

> On Wed, Feb 22, 2017 at 5:50 PM, Isiah Meadows <isiahmeadows at gmail.com>
> wrote:
>
>> I'll point out that Babel doesn't follow spec perfectly because it can't
>> transpile the bindings correctly in the case of synchronously executed code
>> with circular dependencies. That's a CommonJS limitation that Babel can't
>> work around any more than it already does.
>>
> I was wondering about that. Greg, re your example where you said:
>
> In the latest Babel the above code fails to run on the first line of
>> app.js (at the time it attempts to execute `_inherits(B, _A);`.). This is
>> because "A" is undefined in module b.js due to the circular dependency. In
>> this case Babel basically executed code in the incorrect order for this to
>> be able to work.
>
>
> What does the *spec* say should happen in that situation? (You've clearly
> been into it in some detail.) As opposed to what Babel does, since of
> course Babel while excellent is working with some limitations...?
>
> -- T.J. Crowder
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170222/52e283db/attachment.html>


More information about the es-discuss mailing list