diff --git a/src/coffee-script.coffee b/src/coffee-script.coffee index 7e6f76c4..f6c47fe5 100644 --- a/src/coffee-script.coffee +++ b/src/coffee-script.coffee @@ -62,7 +62,8 @@ exports.compile = compile = withPrettyErrors (code, options) -> for fragment in fragments # Update the sourcemap with data from each fragment if options.sourceMap - if fragment.locationData + # Do not include empty, whitespace, or semicolon-only fragments. + if fragment.locationData and not /^[;\s]*$/.test fragment.code map.add( [fragment.locationData.first_line, fragment.locationData.first_column] [currentLine, currentColumn]