How and why would I write a class that extends null?
<p>JavaScript's <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Classes">class syntax</a>, added in ES6, apparently makes it legal to <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/extends#Extending_null">extend <code>null</code></a>:</p>

<pre><code>class foo extends null {}
</code></pre>

<p>Some Googling reveals that it <a href="https://esdiscuss.org/topic/extends-null">was suggested on ES Discuss</a> that such declarations be made an error; however, other commenters argued for them to be left legal on the basis that</p>

<blockquote>
  <p>someone might want to create a class that has a <code>{__proto__: null}</code> prototype</p>
</blockquote>

<p>and that side of the argument ultimately prevailed.</p>

<p>I can't make much sense of this hypothetical use case. For one thing, while the <em>declaration</em> of such a class is legal, it seems that <em>instantiating</em> a class declared in this way isn't. Trying to instantiate the class <code>foo</code> from above in Node.js or Chrome gives me the wonderfully daft error</p>

<pre><code>TypeError: function is not a function
</code></pre>

<p>while doing the same in Firefox gives me</p>

<pre><code>TypeError: function () {
} is not a constructor
</code></pre>

<p>It doesn't help to define a constructor on the class, as shown in MDN's current example of the feature; if I try to instantiate this class:</p>

<pre><code>class bar extends null {
  constructor(){}
}
</code></pre>

<p>then Chrome/Node tell me:</p>

<pre><code>ReferenceError: this is not defined
</code></pre>

<p>and Firefox tells me:</p>

<pre><code>ReferenceError: |this| used uninitialized in bar class constructor
</code></pre>

<p>What is all this madness? Why are these null-extending classes not instantiable? And given that they're not instantiable, why was the possibility of creating them deliberately left in the spec, and why did some MDN author think that it was <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/extends$compare?locale=en-US&amp;to=820971&amp;from=805663">noteworthy enough to document</a>? What possible use case is there for this feature?</p>