square/es6-module-transpiler — pull request #72 by xtian (2013-10-22 09:25:24+00:00)
Title: Omitting semicolon from `import` causes the following line to be truncated

This PR has some failing tests for compiling input with semicolons omitted. I'm not quite sure how to fix the underlying issue, though.

When using semicolons, a whole import statement is parsed as `import { $ } from 'jquery';`. When omitting them, however, the import statement is parsed as `import { $ } from 'jquery'\n`.

[source_modifier.js#L32](https://github.com/square/es6-module-transpiler/blob/master/lib/source_modifier.js#L32) skips the next character after the end of the replaced range. This is typically a newline, but in the cases below it is actually the first character of the next statement.

**Input:**
```js
import $ from "jquery"
console.log('foo')
// Or
import $ from "jquery";console.log('foo')
```
**Output:**
```js
define("application",
["jquery"],
function(__dependency1__) {
"use strict";
var $ = __dependency1__['default'];
onsole.log('foo') // Missing first character
;
});
```