google / traceur-compiler

Traceur is a JavaScript.next-to-JavaScript-of-today compiler
Apache License 2.0
8.17k stars 578 forks source link

So which "compiler" is correct ??? #2136

Closed aabatpurdue closed 7 years ago

aabatpurdue commented 7 years ago

In another universe far, far away - the files in the acorn/src directory all have a '.js' suffix. The files themselves import/export from/to '"./xxx"' <- note no suffix. 'traceur' gets very unfriendly with that form of name specification. If each 'xxx.js' file is copied to 'xxx2.js' and modified to import/export from/to "xxx2.js", 'traceur' is happy.

So according to the newer ECMA specs, which one is correct - with or without?

-- Thanks, -- Paul Townsend

arv commented 7 years ago

ECMAScript does not specify the resolve rules.

The only existing spec for this is in HTML (<script type=module>) which requires full URLs (it does not add .js) so you should include .js in your import declaration.

aabatpurdue commented 7 years ago

Not sure that I agree with the policy of requiring the '.js' suffix in the 'from "./zzz.js"'. It should work both with and without the suffix's presence. Are you familiar with the GNU 'make'. It goes to an extreme amount of trouble finding the proper source file. Maybe 'traceur' and other JS processors should follow suit. One article that I saw on the net said that 'traceur' used to accept '"zzz"'.

This should probably go in another 'issue' but I'm lazy. It seems that 'traceur' doesn't understand the *nix symlink. I get a bunch of strange errors when I attempt to use them. I have a Cygwin installation that sits on top of a Windows Vista Home Basic OS. When I make the following symlinks

cd master/acorn-master/src

for x in *.js ; do

rm ${x%.js}

ln -s $x ${x%.js}

done

traceur --out junk.js index.js

'traceur' produces beaucoup strange errors. If I make the following hard links instead

cd master/acorn-master/src

for x in *.js ; do

rm ${x%.js}

ln $x ${x%.js}

done

traceur --out junk.js index.js

everything seems to work.

-- Thanks,

-- Paul Townsend


From: Erik Arvidsson notifications@github.com Sent: Thursday, October 6, 2016 12:08 AM To: google/traceur-compiler Cc: Paul Townsend; Author Subject: Re: [google/traceur-compiler] So which "compiler" is correct ??? (#2136)

ECMAScript does not specify the resolve rules.

The only existing spec for this is in HTML ( Githubissues.

  • Githubissues is a development platform for aggregating issues.