Permalink
Browse files

Fix invalid output when one of the stitched files ends in comment wit…

…hout newline.

Added test case.
  • Loading branch information...
1 parent 98f71ed commit 355023471e4a809100d84380fa911166728357ec Florin Braghis committed Jan 30, 2012
Showing with 6 additions and 4 deletions.
  1. +2 −2 lib/stitch.js
  2. +1 −1 src/stitch.coffee
  3. +2 −0 test/fixtures/default/ends-in-comment.js
  4. +1 −1 test/test_stitch.coffee
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -114,7 +114,7 @@ exports.Package = class Package
for name, {filename, source} of sources
result += if index++ is 0 then "" else ", "
result += JSON.stringify name
- result += ": function(exports, require, module) {#{source}}"
+ result += ": function(exports, require, module) {#{source}\n}"
result += """
});\n
@@ -0,0 +1,2 @@
+var a;
+//This file ends in a comment
View
@@ -8,7 +8,7 @@ altFixtures = fixtureRoot + "/alternate"
addlFixtures = fixtureRoot + "/additional"
ecoFixtures = fixtureRoot + "/eco"
linkFixtures = fixtureRoot + "/link"
-fixtureCount = 17
+fixtureCount = 18
defaultOptions =
identifier: "testRequire"

0 comments on commit 3550234

Please sign in to comment.