<blockquote>
<p dir="auto">Choose one: is this a bug report or feature request?</p>
</blockquote>

<p dir="auto">bug</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="class X {
  static a = 1;
  static b = this.a;
}

console.log(X.b);"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">X</span> <span class="pl-kos">{</span>
  <span class="pl-k">static</span> <span class="pl-c1">a</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span>
  <span class="pl-k">static</span> <span class="pl-c1">b</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">a</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-v">X</span><span class="pl-kos">.</span><span class="pl-c1">b</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>

<p dir="auto">stage3,stage2</p>
<h3 dir="auto">Expected Behavior</h3>


<p dir="auto">1</p>
<h3 dir="auto">Current Behavior</h3>


<p dir="auto">undefined</p>
<h3 dir="auto">Your Environment</h3>

<p dir="auto"><a href="https://babeljs.io/repl/build/master#?babili=false&amp;browsers=&amp;build=&amp;builtIns=false&amp;code_lz=MYGwhgzhAEAa0G8BQ1oQC5nQS2NM0AvNAIwDcKamOeARkdOgBbYQB0YFAvkksAPYA7CPxABTNiH4BzABSw2tAJRkgA&amp;debug=false&amp;circleciRepo=&amp;evaluate=true&amp;lineWrap=false&amp;presets=stage-2%2Cstage-3&amp;targets=&amp;version=7.0.0-beta.31" rel="nofollow">REPL</a></p>
<p dir="auto">When using babel-plugin-transform-class-properties, it turns out that extending the <a href="https://babeljs.io/docs/plugins/transform-class-properties/" rel="nofollow">https://babeljs.io/docs/plugins/transform-class-properties/</a> example to include a "boundStaticFunction" fails:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  class Bork {
    static staticProperty = &quot;babeliscool&quot;;
    static staticFunction = function() {
      return Bork.staticProperty;
    }
    static boundStaticFunction = () =&gt; {
      return this.staticProperty
    }
  }

  //Static function exists on the class.
  console.log(Bork.staticFunction()); // &gt; &quot;babelIsCool&quot;
  
  // BUG: static functions cannot be bound to class!
  let fn = Bork.boundStaticFunction
  console.log(fn())"><pre class="notranslate"><code class="notranslate">  class Bork {
    static staticProperty = "babeliscool";
    static staticFunction = function() {
      return Bork.staticProperty;
    }
    static boundStaticFunction = () =&gt; {
      return this.staticProperty
    }
  }

  //Static function exists on the class.
  console.log(Bork.staticFunction()); // &gt; "babelIsCool"
  
  // BUG: static functions cannot be bound to class!
  let fn = Bork.boundStaticFunction
  console.log(fn())
</code></pre></div>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">Calling <code class="notranslate">(Bork.boundStaticFunction)()</code> should behave the same way as <code class="notranslate">Bork.boundStaticFunction()</code>.</p>
<p dir="auto">Babel would emit code either like</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Bork.boundStaticFunction = function () {
  return this.staticProperty;
}.bind(Bork);"><pre class="notranslate"><code class="notranslate">Bork.boundStaticFunction = function () {
  return this.staticProperty;
}.bind(Bork);
</code></pre></div>
<p dir="auto">or:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Bork.boundStaticFunction = function () {
  return Bork.staticProperty;
}"><pre class="notranslate"><code class="notranslate">Bork.boundStaticFunction = function () {
  return Bork.staticProperty;
}
</code></pre></div>
<h2 dir="auto">Actual results</h2>
<p dir="auto">Calling <code class="notranslate">(Bork.boundStaticFunction)()</code> results in an error:</p>
<blockquote>
<p dir="auto">Cannot read property 'staticProperty' of undefined</p>
</blockquote>
<p dir="auto">Babel has output this code (literally):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Bork.boundStaticFunction = function () {
  return undefined.staticProperty;
};"><pre class="notranslate"><code class="notranslate">Bork.boundStaticFunction = function () {
  return undefined.staticProperty;
};
</code></pre></div>
<h2 dir="auto">Related behavior</h2>
<p dir="auto">Binding an <em>instance</em> property in a similar fashion does work as desired.</p>