Repository: babel/babel (TypeScript)

Issue:
[Bug]: Babel breaks on Source Maps merge when adding multi-line block comments through babel-core `NodePath.addComment` API
### 💻

- [ ] Would you like to work on a fix?

### How are you using Babel?

@babel/cli

### Input code

## Minimal Reproducible Example
https://github.com/ernestostifano/babel-comments-issue

### Configuration file name

babel.config.json

### Configuration

```json
{
    "plugins": ["./babel-plugin-custom.js"]
}
```

### Current and expected behavior

## Steps to Reproduce
1. Clone [Minimal Reproducible Example](https://github.com/ernestostifano/babel-comments-issue).
2. Run `npm install`.
3. See available scripts in `package.json` and run them as needed. (EX: `npm run succeeds1` or `npm run fails1`).

**NOTE:** There are several scripts in the `package.json`. All cases combining source maps and comments addition in both builds (`case` scripts) and then failed and succeed cases (`fails` and `succeeds` scripts).

## Description

It seems that there is an issue when using [`function babel-core.traverse.NodePath.prototype.addComment`](https://npmdoc.github.io/node-npmdoc-babel-core/build/apidoc.html#apidoc.element.babel-core.traverse.NodePath.prototype.addComment) to add multi-line comments (by a Babel plugin) and source maps merge.

From tests, it seems that it is enough to trigger an initial build with source maps enabled (without necessarily adding any comment through a plugin) and then a second build (on the output of the first one) that tries to add a multi-line comment and also has source maps enabled (in fact, Babel seems ti break on source map merge step, see error below). (See `case17` script.)

Please, also note:

- If the second build tries to add a single-line comment with source maps enabled, it works.
- If the second build tries to add a multi-line comment with source maps disabled, it works.
- So it is a combination of source maps on first build and multi-line comments + source maps on second build.

```bash
TypeError: /path/to/repo/babel-comments-issue/build1/index.js: Cannot read properties of undefined (reading 'length')
    at memoizedBinarySearch (/path/to/repo/babel-comments-issue/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js:138:29)
    at traceSegmentInternal (/path/to/repo/babel-comments-issue/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js:520:21)
    at Object.exports.traceSegment (/path/to/repo/babel-comments-issue/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js:394:27)
    at originalPositionFor (/path/to/repo/babel-comments-issue/node_modules/@ampproject/remapping/dist/remapping.umd.js:90:38)
    at traceMappings (/path/to/repo/babel-comments-issue/node_modules/@ampproject/remapping/dist/remapping.umd.js:59:30)
    at remapping (/path/to/repo/babel-comments-issue/node_modules/@ampproject/remapping/dist/remapping.umd.js:203:30)
    at mergeSourceMap (/path/to/repo/babel-comments-issue/node_modules/@babel/core/lib/transformation/file/merge-map.js:17:30)
    at generateCode (/path/to/repo/babel-comments-issue/node_modules/@babel/core/lib/transformation/file/generate.js:61:41)
    at run (/path/to/repo/babel-comments-issue/node_modules/@babel/core/lib/transformation/index.js:39:33)
    at run.next (<anonymous>) {
  code: 'BABEL_GENERATE_ERROR'
}
```


### Environment

System:
  OS: macOS 12.6.2
Binaries:
  Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
  Yarn: 3.2.3 - ~/.nvm/versions/node/v16.15.0/bin/yarn
  npm: 8.10.0 - ~/.nvm/versions/node/v16.15.0/bin/npm

### Possible solution

N/A.

### Additional context

<details>
<summary>Custom Plugin Code</summary>

`./babel-plugin-custom.js`

```js
const multi = `
line1
line2
`;

const single = 'line1';

module.exports = function babelPluginCustom() {
    const isSingle = process.env.NPM_CONFIG_SINGLE === 'true';
    return {
        visitor: {
            Program(path) {
                path.addComment('leading', isSingle ? single : multi);
            }
        }
    };
};

```

</details>


Hints:
Hey @ernestostifano! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant [Slack community](https://babeljs.slack.com) that typically always has someone willing to help. You can sign-up [here](https://slack.babeljs.io/) for an invite.

Patch:
diff --git a/packages/babel-generator/src/buffer.ts b/packages/babel-generator/src/buffer.ts
--- a/packages/babel-generator/src/buffer.ts
+++ b/packages/babel-generator/src/buffer.ts
@@ -261,7 +261,8 @@ export default class Buffer {
 
       // We mark the start of each line, which happens directly after this newline char
       // unless this is the last char.
-      if (last < len) {
+      // When manually adding multi-line content (such as a comment), `line` will be `undefined`.
+      if (last < len && line !== undefined) {
         this._mark(++line, 0, identifierName, filename);
       }
       i = str.indexOf("\n", last);
diff --git a/packages/babel-helper-transform-fixture-test-runner/src/index.ts b/packages/babel-helper-transform-fixture-test-runner/src/index.ts
--- a/packages/babel-helper-transform-fixture-test-runner/src/index.ts
+++ b/packages/babel-helper-transform-fixture-test-runner/src/index.ts
@@ -513,8 +513,15 @@ export default function (
 
           async function () {
             const runTask = () => run(task);
-            if ("sourceMap" in task.options === false) {
-              task.options.sourceMap = !!task.sourceMap;
+
+            if ("sourceMap" in task.options) {
+              throw new Error(
+                "`sourceMap` option is deprecated. Use `sourceMaps` instead.",
+              );
+            }
+
+            if ("sourceMaps" in task.options === false) {
+              task.options.sourceMaps = !!task.sourceMap;
             }
 
             Object.assign(task.options, taskOpts);


Test patch:
diff --git a/packages/babel-cli/test/fixtures/babel/filename-sourcemap --out-file --source-maps inline/in-files/.babelrc b/packages/babel-cli/test/fixtures/babel/filename-sourcemap --out-file --source-maps inline/in-files/.babelrc
--- a/packages/babel-cli/test/fixtures/babel/filename-sourcemap --out-file --source-maps inline/in-files/.babelrc	
+++ b/packages/babel-cli/test/fixtures/babel/filename-sourcemap --out-file --source-maps inline/in-files/.babelrc	
@@ -1,3 +1,3 @@
 {
-    "sourceMap": "inline"
-}
+    "sourceMaps": "inline"
+}
\ No newline at end of file
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/index.js.map b/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/index.js.map
new file mode 100644
--- /dev/null
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/index.js.map
@@ -0,0 +1,10 @@
+{
+  "version": 3,
+  "file": "index.js",
+  "names": ["myConst"],
+  "sources": ["../src/index.js"],
+  "sourcesContent": [
+    "const myConst = 'ANY CODE OR NO CODE AT ALL';\n\nexport {myConst};\n"
+  ],
+  "mappings": ";AAAA;AAAA;AAAA;AAAA,MAAMA,OAAO,GAAG,4BAA4B;AAE5C,SAAQA,OAAO"
+}
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/input.js b/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/input.js
new file mode 100644
--- /dev/null
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/input.js
@@ -0,0 +1,6 @@
+/*
+line1
+line2
+*/
+const myConst = 'ANY CODE OR NO CODE AT ALL';
+export { myConst };
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/options.json b/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/options.json
new file mode 100644
--- /dev/null
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/options.json
@@ -0,0 +1,5 @@
+{
+  "sourceType": "module",
+  "inputSourceMap": true,
+  "plugins": ["./plugin.js"]
+}
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/output.mjs b/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/output.mjs
new file mode 100644
--- /dev/null
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/output.mjs
@@ -0,0 +1,8 @@
+/*line1
+line2*/
+/*
+line1
+line2
+*/
+const myConst = 'ANY CODE OR NO CODE AT ALL';
+export { myConst };
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/plugin.js b/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/plugin.js
new file mode 100644
--- /dev/null
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/plugin.js
@@ -0,0 +1,9 @@
+module.exports = function () {
+  return {
+    visitor: {
+      Program(path) {
+        path.addComment("leading", "line1\nline2");
+      },
+    },
+  };
+};
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/source-map.json b/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/source-map.json
new file mode 100644
--- /dev/null
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/add-multi-line-comments/source-map.json
@@ -0,0 +1,13 @@
+{
+  "version": 3,
+  "names": [
+    "myConst"
+  ],
+  "sources": [
+    "source-maps/add-multi-line-comments/input.js"
+  ],
+  "sourcesContent": [
+    "/*\nline1\nline2\n*/\nconst myConst = 'ANY CODE OR NO CODE AT ALL';\nexport { myConst };"
+  ],
+  "mappings": ";;AAAA;AACA;AACA;AACA;AACA,MAAMA,OAAO,GAAG,4BAA4B;AAC5C,SAASA,OAAO"
+}
\ No newline at end of file
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/arrow-function/options.json b/packages/babel-core/test/fixtures/transformation/source-maps/arrow-function/options.json
--- a/packages/babel-core/test/fixtures/transformation/source-maps/arrow-function/options.json
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/arrow-function/options.json
@@ -1,4 +1,4 @@
 {
   "plugins": ["transform-arrow-functions", "transform-function-name"],
-  "sourceMap": true
+  "sourceMaps": true
 }
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/class/options.json b/packages/babel-core/test/fixtures/transformation/source-maps/class/options.json
--- a/packages/babel-core/test/fixtures/transformation/source-maps/class/options.json
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/class/options.json
@@ -1,4 +1,4 @@
 {
   "plugins": ["transform-classes", "transform-block-scoping"],
-  "sourceMap": true
+  "sourceMaps": true
 }
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/class/source-map.json b/packages/babel-core/test/fixtures/transformation/source-maps/class/source-map.json
--- a/packages/babel-core/test/fixtures/transformation/source-maps/class/source-map.json
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/class/source-map.json
@@ -12,5 +12,5 @@
   "sourcesContent": [
     "class Test {\n  get bar() {\n    throw new Error(\"wow\");\n  }\n}\n\nvar test = new Test;\ntest.bar;"
   ],
-  "mappings": "IAAMA,IAAI;EAAA;;EAAA;IAAA;EAAA;;EAAA;IAAA;IAAA,KACR,YAAU;MACR,MAAM,IAAIC,KAAK,CAAC,KAAK,CAAC;IACxB;EAAC;EAAA;AAAA;;AAGH,IAAIC,IAAI,GAAG,IAAIF,IAAI;AACnBE,IAAI,CAACC,GAAG"
+  "mappings": "IAAMA,IAAI;EAAA;;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA,KACR,YAAU;MACR,MAAM,IAAIC,KAAK,CAAC,KAAK,CAAC;IACxB;EAAC;EAAA;AAAA;AAGH,IAAIC,IAAI,GAAG,IAAIF,IAAI;AACnBE,IAAI,CAACC,GAAG"
 }
\ No newline at end of file
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/inline/options.json b/packages/babel-core/test/fixtures/transformation/source-maps/inline/options.json
--- a/packages/babel-core/test/fixtures/transformation/source-maps/inline/options.json
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/inline/options.json
@@ -1,4 +1,4 @@
 {
   "plugins": ["transform-arrow-functions"],
-  "sourceMap": "inline"
+  "sourceMaps": "inline"
 }
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-complex/options.json b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-complex/options.json
--- a/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-complex/options.json
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-complex/options.json
@@ -1,4 +1,4 @@
 {
   "plugins": ["transform-modules-commonjs"],
-  "sourceMap": true
+  "sourceMaps": true
 }
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-complex/source-map.json b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-complex/source-map.json
--- a/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-complex/source-map.json
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-complex/source-map.json
@@ -1,6 +1,6 @@
 {
   "version": 3,
-  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAsFA;EACAA;;EACAC;IACA;MACAC;IACA;EACA;;AACA",
+  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAsFA;EACAA;EACAC;IACA;MACAC;IACA;EACA;AACA",
   "names": [
     "name",
     "data",
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-multiple-output-sources/source-map.json b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-multiple-output-sources/source-map.json
--- a/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-multiple-output-sources/source-map.json
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-multiple-output-sources/source-map.json
@@ -1,6 +1,6 @@
 {
   "version": 3,
-  "mappings": "AAAC,KAAG;;ACCJ,SAASA,GAAG,CAACC,GAAW;EACpB,MAAM,IAAIC,KAAK,CAAC,cAAc,CAAC;AACnC",
+  "mappings": "AAAC,KAAG;ACCJ,SAASA,GAAG,CAACC,GAAW;EACpB,MAAM,IAAIC,KAAK,CAAC,cAAc,CAAC;AACnC",
   "names": [
     "foo",
     "bar",
diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/interpreter-directive-prefix/options.json b/packages/babel-core/test/fixtures/transformation/source-maps/interpreter-directive-prefix/options.json
--- a/packages/babel-core/test/fixtures/transformation/source-maps/interpreter-directive-prefix/options.json
+++ b/packages/babel-core/test/fixtures/transformation/source-maps/interpreter-directive-prefix/options.json
@@ -1,3 +1,3 @@
 {
-  "sourceMap": true
+  "sourceMaps": true
 }
diff --git a/packages/babel-plugin-transform-destructuring/test/fixtures/sourcemap/declaration-loc/options.json b/packages/babel-plugin-transform-destructuring/test/fixtures/sourcemap/declaration-loc/options.json
--- a/packages/babel-plugin-transform-destructuring/test/fixtures/sourcemap/declaration-loc/options.json
+++ b/packages/babel-plugin-transform-destructuring/test/fixtures/sourcemap/declaration-loc/options.json
@@ -1,4 +1,4 @@
 {
   "plugins": ["transform-destructuring"],
-  "sourceMap": true
+  "sourceMaps": true
 }
diff --git a/packages/babel-plugin-transform-destructuring/test/fixtures/sourcemap/declaration-loc/source-map.json b/packages/babel-plugin-transform-destructuring/test/fixtures/sourcemap/declaration-loc/source-map.json
--- a/packages/babel-plugin-transform-destructuring/test/fixtures/sourcemap/declaration-loc/source-map.json
+++ b/packages/babel-plugin-transform-destructuring/test/fixtures/sourcemap/declaration-loc/source-map.json
@@ -12,5 +12,5 @@
   "sourcesContent": [
     "const fn = (arg) => {\n  var [x, y] = arg;\n}"
   ],
-  "mappings": "AAAA,MAAMA,EAAE,GAAIC,GAAG,IAAK;EAClB,sCAAaA,GAAG;EAAA,IAAXC,CAAC;EAAA,IAAEC,CAAC;AACX,CAAC"
+  "mappings": "AAAA,MAAMA,EAAE,GAAIC,GAAG,IAAK;EAClB,sCAAaA,GAAG;IAAXC,CAAC;IAAEC,CAAC;AACX,CAAC"
 }
\ No newline at end of file
diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/options.json
--- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/options.json
+++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/options.json
@@ -1,5 +1,5 @@
 {
   "externalHelpers": true,
   "plugins": ["transform-modules-commonjs"],
-  "sourceMap": true
+  "sourceMaps": true
 }
diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/source-map.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/source-map.json
--- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/source-map.json
+++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/source-map.json
@@ -14,5 +14,5 @@
   "sourcesContent": [
     "import aDefault from \"one\";\nimport { aNamed } from \"two\";\nimport { orig as anAliased } from \"three\";\nimport * as aNamespace from \"four\";\n\nconsole.log(aDefault);\nconsole.log(aNamed);\nconsole.log(anAliased);\nconsole.log(aNamespace);\n\nconsole.log(aDefault());\nconsole.log(aNamed());\nconsole.log(anAliased());\nconsole.log(aNamespace());"
   ],
-  "mappings": ";;AAAA;;AACA;;AACA;;AACA;AAEAA,OAAO,CAACC,GAAG,CAACC,YAAQ,CAAC;AACrBF,OAAO,CAACC,GAAG,CAACE,WAAM,CAAC;AACnBH,OAAO,CAACC,GAAG,CAACG,WAAS,CAAC;AACtBJ,OAAO,CAACC,GAAG,CAACI,UAAU,CAAC;AAEvBL,OAAO,CAACC,GAAG,CAAC,IAAAC,YAAQ,GAAE,CAAC;AACvBF,OAAO,CAACC,GAAG,CAAC,IAAAE,WAAM,GAAE,CAAC;AACrBH,OAAO,CAACC,GAAG,CAAC,IAAAG,WAAS,GAAE,CAAC;AACxBJ,OAAO,CAACC,GAAG,CAACI,UAAU,EAAE,CAAC"
+  "mappings": ";;AAAA;AACA;AACA;AACA;AAEAA,OAAO,CAACC,GAAG,CAACC,YAAQ,CAAC;AACrBF,OAAO,CAACC,GAAG,CAACE,WAAM,CAAC;AACnBH,OAAO,CAACC,GAAG,CAACG,WAAS,CAAC;AACtBJ,OAAO,CAACC,GAAG,CAACI,UAAU,CAAC;AAEvBL,OAAO,CAACC,GAAG,CAAC,IAAAC,YAAQ,GAAE,CAAC;AACvBF,OAAO,CAACC,GAAG,CAAC,IAAAE,WAAM,GAAE,CAAC;AACrBH,OAAO,CAACC,GAAG,CAAC,IAAAG,WAAS,GAAE,CAAC;AACxBJ,OAAO,CAACC,GAAG,CAACI,UAAU,EAAE,CAAC"
 }
\ No newline at end of file
diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/options.json
--- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/options.json
+++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/options.json
@@ -1 +1 @@
-{ "sourceMap": true }
+{ "sourceMaps": true }
diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/sourcemaps/JSXText/options.json b/packages/babel-plugin-transform-react-jsx/test/fixtures/sourcemaps/JSXText/options.json
--- a/packages/babel-plugin-transform-react-jsx/test/fixtures/sourcemaps/JSXText/options.json
+++ b/packages/babel-plugin-transform-react-jsx/test/fixtures/sourcemaps/JSXText/options.json
@@ -1,5 +1,5 @@
 {
   "sourceType": "module",
   "plugins": [["transform-react-jsx", { "runtime": "classic" }]],
-  "sourceMap": true
+  "sourceMaps": true
 }
diff --git a/packages/babel-traverse/test/fixtures/conversion/arguments-source-maps/options.json b/packages/babel-traverse/test/fixtures/conversion/arguments-source-maps/options.json
--- a/packages/babel-traverse/test/fixtures/conversion/arguments-source-maps/options.json
+++ b/packages/babel-traverse/test/fixtures/conversion/arguments-source-maps/options.json
@@ -1,4 +1,4 @@
 {
   "plugins": ["transform-arrow-functions"],
-  "sourceMap": true
+  "sourceMaps": true
 }
diff --git a/packages/babel-traverse/test/fixtures/conversion/arguments-source-maps/source-map.json b/packages/babel-traverse/test/fixtures/conversion/arguments-source-maps/source-map.json
--- a/packages/babel-traverse/test/fixtures/conversion/arguments-source-maps/source-map.json
+++ b/packages/babel-traverse/test/fixtures/conversion/arguments-source-maps/source-map.json
@@ -13,5 +13,5 @@
   "sourcesContent": [
     "function fn() {\n  var inner = () => {\n    console.log(arguments);\n  };\n}"
   ],
-  "mappings": "AAAA,SAASA,EAAE,GAAG;EAAA;;EACZ,IAAIC,KAAK,GAAG,YAAM;IAChBC,OAAO,CAACC,GAAG,CAACC,UAAS,CAAC;EACxB,CAAC;AACH"
+  "mappings": "AAAA,SAASA,EAAE,GAAG;EAAA;EACZ,IAAIC,KAAK,GAAG,YAAM;IAChBC,OAAO,CAACC,GAAG,CAACC,UAAS,CAAC;EACxB,CAAC;AACH"
 }
\ No newline at end of file
diff --git a/packages/babel-traverse/test/fixtures/conversion/this-source-maps/options.json b/packages/babel-traverse/test/fixtures/conversion/this-source-maps/options.json
--- a/packages/babel-traverse/test/fixtures/conversion/this-source-maps/options.json
+++ b/packages/babel-traverse/test/fixtures/conversion/this-source-maps/options.json
@@ -1,4 +1,4 @@
 {
   "plugins": ["transform-arrow-functions"],
-  "sourceMap": true
+  "sourceMaps": true
 }
diff --git a/packages/babel-traverse/test/fixtures/conversion/this-source-maps/source-map.json b/packages/babel-traverse/test/fixtures/conversion/this-source-maps/source-map.json
--- a/packages/babel-traverse/test/fixtures/conversion/this-source-maps/source-map.json
+++ b/packages/babel-traverse/test/fixtures/conversion/this-source-maps/source-map.json
@@ -12,5 +12,5 @@
   "sourcesContent": [
     "function fn() {\n  var inner = () => {\n    console.log(this);\n  };\n}"
   ],
-  "mappings": "AAAA,SAASA,EAAE,GAAG;EAAA;;EACZ,IAAIC,KAAK,GAAG,YAAM;IAChBC,OAAO,CAACC,GAAG,CAAC,KAAI,CAAC;EACnB,CAAC;AACH"
+  "mappings": "AAAA,SAASA,EAAE,GAAG;EAAA;EACZ,IAAIC,KAAK,GAAG,YAAM;IAChBC,OAAO,CAACC,GAAG,CAAC,KAAI,CAAC;EACnB,CAAC;AACH"
 }
\ No newline at end of file