<p dir="auto">I recently tried <code class="notranslate">babel@7.0.0-beta.35</code> and I noticed that there's a regression.</p>
<p dir="auto">My dependency chain is:<br>
(my project) &lt;-- <code class="notranslate">@babel/preset-stage-0</code> &lt;-- <code class="notranslate">@babel/preset-stage-1</code> &lt;-- <code class="notranslate">@babel/plugin-proposal-decorators</code></p>
<p dir="auto">It looks like the pre-beta.35 version of the plugin did opt out because of this code:</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/babel/babel/blob/a7c9264c792baf8aa09ae47887c88863245eb4ca/packages/babel-plugin-proposal-decorators/src/index.js#L375-L381">babel/packages/babel-plugin-proposal-decorators/src/index.js</a>
    </p>
    <p class="mb-0 color-fg-muted">
        Lines 375 to 381
      in
      <a data-pjax="true" class="commit-tease-sha" href="/babel/babel/commit/a7c9264c792baf8aa09ae47887c88863245eb4ca">a7c9264</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L375" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="375"></td>
          <td id="LC375" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L376" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="376"></td>
          <td id="LC376" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   <span class="pl-c1">!</span><span class="pl-s1">path</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L377" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="377"></td>
          <td id="LC377" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">"right.callee"</span><span class="pl-kos">)</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L378" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="378"></td>
          <td id="LC378" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-kos">.</span><span class="pl-en">isIdentifier</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s1">state</span><span class="pl-kos">.</span><span class="pl-c1">initializerWarningHelper</span><span class="pl-kos">.</span><span class="pl-c1">name</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L379" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="379"></td>
          <td id="LC379" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L380" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="380"></td>
          <td id="LC380" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   <span class="pl-k">return</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L381" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="381"></td>
          <td id="LC381" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">While beta.35 does not opt out at its replacement:</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/babel/babel/blob/8a4124b2ffaf33f032383667fa7956bf64759828/packages/babel-plugin-proposal-decorators/src/index.js#L261">babel/packages/babel-plugin-proposal-decorators/src/index.js</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 261
      in
      <a data-pjax="true" class="commit-tease-sha" href="/babel/babel/commit/8a4124b2ffaf33f032383667fa7956bf64759828">8a4124b</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L261" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="261"></td>
          <td id="LC261" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">"right.callee"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">isIdentifier</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-k">return</span><span class="pl-kos">;</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">(introduced via <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/babel/babel/commit/9cc0a26694df2a5af508689d7f7b145e7ca483a5/hovercard" href="https://github.com/babel/babel/commit/9cc0a26694df2a5af508689d7f7b145e7ca483a5"><tt>9cc0a26</tt></a>)</p>
<p dir="auto">I was not able to track it down to a minimum reproducible example yet.<br>
All I was able to check is that the result of expression <code class="notranslate">path.get("right.arguments")</code> in</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/babel/babel/blob/8a4124b2ffaf33f032383667fa7956bf64759828/packages/babel-plugin-proposal-decorators/src/index.js#L268">babel/packages/babel-plugin-proposal-decorators/src/index.js</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 268
      in
      <a data-pjax="true" class="commit-tease-sha" href="/babel/babel/commit/8a4124b2ffaf33f032383667fa7956bf64759828">8a4124b</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L268" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="268"></td>
          <td id="LC268" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">"right.arguments"</span><span class="pl-kos">)</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-c1">node</span><span class="pl-kos">,</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">has length of <code class="notranslate">1</code>.<br>
I also checked that adding <code class="notranslate">if (!path.get("right.arguments")[1]) return;</code> prevents the error from being triggered but it was only a blind guess of mine to add that line there. I'm not aware of the consequences of such move</p>
<table role="table">
<thead>
<tr>
<th>software</th>
<th>version(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Babel</td>
<td>7.0.0-beta.35</td>
</tr>
<tr>
<td>Babylon</td>
<td>n/a </td>
</tr>
<tr>
<td>node</td>
<td>8.9.1</td>
</tr>
<tr>
<td>npm</td>
<td>5.5.1</td>
</tr>
<tr>
<td>Operating System</td>
<td>macOS 10.13.1</td>
</tr>
</tbody>
</table>
<p dir="auto">Choose one:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> bug</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> feature</li>
</ul>
<p dir="auto"><a href="https://github.com/julien-f/babel-decorators-issue">Repro repository</a>.</p>
<h3 dir="auto">Input Code</h3>


<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="global.foo = f()"><pre class="notranslate"><span class="pl-s1">global</span><span class="pl-kos">.</span><span class="pl-c1">foo</span> <span class="pl-c1">=</span> <span class="pl-en">f</span><span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div>
<h3 dir="auto">Babel/Babylon Configuration (.babelrc, package.json, cli command)</h3>

<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;plugins&quot;: [
    &quot;@babel/plugin-proposal-decorators&quot;
  ]
}"><pre class="notranslate">{
  <span class="pl-ent">"plugins"</span>: [
    <span class="pl-s"><span class="pl-pds">"</span>@babel/plugin-proposal-decorators<span class="pl-pds">"</span></span>
  ]
}</pre></div>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">It should compile the code.</p>
<h3 dir="auto">Current Behavior</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TypeError: Cannot read property 'node' of undefined
    at PluginPass.AssignmentExpression (&lt;dir&gt;/node_modules/@babel/plugin-proposal-decorators/lib/index.js:139:224)
    at newFn (&lt;dir&gt;/node_modules/@babel/traverse/lib/visitors.js:223:21)
    at NodePath._call (&lt;dir&gt;/node_modules/@babel/traverse/lib/path/context.js:64:19)
    at NodePath.call (&lt;dir&gt;/node_modules/@babel/traverse/lib/path/context.js:38:17)
    at NodePath.visit (&lt;dir&gt;/node_modules/@babel/traverse/lib/path/context.js:99:12)
    at TraversalContext.visitQueue (&lt;dir&gt;/node_modules/@babel/traverse/lib/context.js:139:18)
    at TraversalContext.visitSingle (&lt;dir&gt;/node_modules/@babel/traverse/lib/context.js:98:19)
    at TraversalContext.visit (&lt;dir&gt;/node_modules/@babel/traverse/lib/context.js:180:19)
    at Function.traverse.node (&lt;dir&gt;/node_modules/@babel/traverse/lib/index.js:76:17)
    at NodePath.visit (&lt;dir&gt;/node_modules/@babel/traverse/lib/path/context.js:106:18)"><pre class="notranslate"><code class="notranslate">TypeError: Cannot read property 'node' of undefined
    at PluginPass.AssignmentExpression (&lt;dir&gt;/node_modules/@babel/plugin-proposal-decorators/lib/index.js:139:224)
    at newFn (&lt;dir&gt;/node_modules/@babel/traverse/lib/visitors.js:223:21)
    at NodePath._call (&lt;dir&gt;/node_modules/@babel/traverse/lib/path/context.js:64:19)
    at NodePath.call (&lt;dir&gt;/node_modules/@babel/traverse/lib/path/context.js:38:17)
    at NodePath.visit (&lt;dir&gt;/node_modules/@babel/traverse/lib/path/context.js:99:12)
    at TraversalContext.visitQueue (&lt;dir&gt;/node_modules/@babel/traverse/lib/context.js:139:18)
    at TraversalContext.visitSingle (&lt;dir&gt;/node_modules/@babel/traverse/lib/context.js:98:19)
    at TraversalContext.visit (&lt;dir&gt;/node_modules/@babel/traverse/lib/context.js:180:19)
    at Function.traverse.node (&lt;dir&gt;/node_modules/@babel/traverse/lib/index.js:76:17)
    at NodePath.visit (&lt;dir&gt;/node_modules/@babel/traverse/lib/path/context.js:106:18)
</code></pre></div>
<h3 dir="auto">Your Environment</h3>

<table role="table">
<thead>
<tr>
<th>software</th>
<th>version(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Babel</td>
<td>7.0.0-beta.35</td>
</tr>
<tr>
<td>Babylon</td>
<td></td>
</tr>
<tr>
<td>node</td>
<td>9.3.0</td>
</tr>
<tr>
<td>npm</td>
<td>5.5.1</td>
</tr>
<tr>
<td>Operating System</td>
<td>Fedora 27</td>
</tr>
</tbody>
</table>