detecting JS language mode for tools

John Barton johnjbarton at google.com
Mon Jan 27 17:35:46 PST 2014


On Mon, Jan 27, 2014 at 4:57 PM, Brendan Eich <brendan at mozilla.com> wrote:

> John Barton wrote:
>
>>
>>
>>     It's pretty clear from NPM experience that a new suffix is not
>>     needed for out-of-line modules. Or are you suggesting that Node.js
>>     lacks tooling? I'm not offended, just trying to understand.
>>
>>
>> What about the node experience helps? They have only one type of input,
>> modules, ergo only one suffix.
>>
>
> No, their non-module main programs are in files with names ending in .js.


Their non-module main programs don't fail if you issue require().


>
>
>      For NPM read AMD/require.js too.
>>
>>
>> Ditto.
>>
>
> No, <script src=foo.js> interops with AMD/require.js and the .js suffix is
> used everywhere.


Because it is js everywhere. Pick any file in an AMD/require.js system and
you can parse it.

I think you are on the right track here: 1JS needs only one file suffix.
 If we have two languages, we need to suffixes.

jjb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140127/7e1a4ab8/attachment.html>


More information about the es-discuss mailing list