jashkenas / coffeescript

Unfancy JavaScript
https://coffeescript.org/
MIT License
16.5k stars 1.99k forks source link

Only first file fed to compiler is wrapped; the rest are bare #2067

Closed Flambino closed 12 years ago

Flambino commented 12 years ago

When compiling several files (without --join concatenation), only the first file in the list gets compiled with a function-wrapper. All following files are compiled without the wrapper (but still indented, and with blank line top and and bottom, as though the wrapper's there).

Example:

$ coffee -c file_a.coffee file_b.coffee

Will output:

_filea.js

(function() {
  // ... file_a's code - wrapped
}).call(this);

_fileb.js

   // ... file_b's code - no function wrapper!

I noticed this in version 1.1.3. Don't know if 1.2.0 behaves differently.

haileys commented 12 years ago

Doesn't seem to affect 1.2.0

% coffee -c a.coffee b.coffee
% cat a.js b.js
(function() {

  a(1);

}).call(this);
(function() {

  b(2);

}).call(this);
%
showell commented 12 years ago

Here are the release notes: http://coffeescript.org/#changelog

@Flambino I don't see anything obvious in the change log about this being fixed between 1.1.13 and 1.2.0, but if you cannot repo this under 1.2.0, I would close the issue. It looks like there is good reason to get off 1.1.13 anyway.

Flambino commented 12 years ago

@showell Yeah, I didn't see anything under the changelog either (hence the issue).

But release notes or not, I can't repro it in version 1.2.0, so yay! I'll close the issue.

showell commented 12 years ago

@Flambino Cool. Sorry, didn't mean to imply you didn't do due diligence, was just curious myself and not sure you saw the notes.

michaelficarra commented 12 years ago

A simple git bisect would clear this up...

Flambino commented 12 years ago

@showell No offense taken, don't worry - I halfway expected I might have missed something anyway

@michaelficarra No doubt, but I'm just happy it's fixed now; let sleeping dogs lie, etc :)