ES6 Dynamically instantiate class
<p>I'm wondering if this is a Chrome issue or it's by design (which would be inconsistent with all other objects in JavaScript).</p>

<p>Classes can't be instantiated dynamically like other objects. Consider this code:</p>

<pre><code>class BaseClass {

}
</code></pre>

<p>And somewhere you want to dynamically create instance of this class:</p>

<pre><code>var inst;
if (window[fnName].constructor) {
  try {
    inst = new window[fnName](value);
  } catch (e) {}
} else {
  inst = window[fnName](value);
}
</code></pre>

<p>Code from function above will fail (at leas in strict mode) because window object does not contain BaseClass. And this is not natural in JavaScript because defined objects / function are available in window object.</p>

<p>if I change the code to </p>

<pre><code>return new BaseClass(value);
</code></pre>

<p>it is working as it should. 
So where classes definitions are kept? In global object? Not really. But they are available. Help me solve this.</p>