<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
Using typescript if I have a class that extends from another class fields in the extending class are overwritten with undefined. This happens after the constructor has finished and it occurs in the defineProperty.js of babelRuntime.</p>
<p dir="auto"><strong>Input Code</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Base {
    constructor(dto?){
        if(dto){
            this.updateFromDTO(dto);
        }
    }

    updateFromDTO(dto) : this{
        return this;
    }
}


class Extends extends Base {
    myField: string;

    updateFromDTO(dto) {
        super.updateFromDTO(dto);
        console.log('I was called');
        this.myField = &quot;weee&quot;;
        console.log(this.myField);
        return this;
    }
}

console.log(new Extends(&quot;123&quot;));
// Console shows: 'I was Logged' and then 'weee'. Then the Extends object.  The extends object has myField as undefined."><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">Base</span> <span class="pl-kos">{</span>
    <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-s1">dto</span>?<span class="pl-kos">)</span><span class="pl-kos">{</span>
        <span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-s1">dto</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
            <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">updateFromDTO</span><span class="pl-kos">(</span><span class="pl-s1">dto</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span>
    <span class="pl-kos">}</span>

    <span class="pl-en">updateFromDTO</span><span class="pl-kos">(</span><span class="pl-s1">dto</span><span class="pl-kos">)</span> : <span class="pl-smi">this</span><span class="pl-kos">{</span>
        <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span>


<span class="pl-k">class</span> <span class="pl-v">Extends</span> <span class="pl-k">extends</span> <span class="pl-v">Base</span> <span class="pl-kos">{</span>
    <span class="pl-c1">myField</span>: <span class="pl-c1">string</span><span class="pl-kos">;</span>

    <span class="pl-en">updateFromDTO</span><span class="pl-kos">(</span><span class="pl-s1">dto</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-smi">super</span><span class="pl-kos">.</span><span class="pl-en">updateFromDTO</span><span class="pl-kos">(</span><span class="pl-s1">dto</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-s">'I was called'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">myField</span> <span class="pl-c1">=</span> <span class="pl-s">"weee"</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-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">myField</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">;</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-k">new</span> <span class="pl-v">Extends</span><span class="pl-kos">(</span><span class="pl-s">"123"</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Console shows: 'I was Logged' and then 'weee'. Then the Extends object.  The extends object has myField as undefined.</span></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
For the field I set in Extends to still be set after the constructor is finished.</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
babel.config.js
const DEVELOPMENT = 'production' !== process.env.NODE_ENV

module.exports = {
    presets: [
        [&quot;@babel/preset-env&quot;, {useBuiltIns: &quot;entry&quot;}],
        &quot;@babel/preset-react&quot;,
        &quot;@babel/typescript&quot;
    ],
    plugins: [
        &quot;@babel/plugin-proposal-class-properties&quot;,
        &quot;@babel/plugin-proposal-export-default-from&quot;,
        &quot;@babel/plugin-syntax-dynamic-import&quot;,
        [&quot;@babel/plugin-transform-runtime&quot;, {&quot;regenerator&quot;: true}],
        &quot;@babel/plugin-transform-classes&quot;,
    ],
}

package.json
{
  &quot;name&quot;: &quot;webclient2.1&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;description&quot;: &quot;&quot;,
  &quot;main&quot;: &quot;index.js&quot;,
  &quot;scripts&quot;: {
    &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;,
    &quot;start&quot;: &quot;node_modules/.bin/webpack-dev-server --mode development --open --hot&quot;
  },
  &quot;author&quot;: &quot;&quot;,
  &quot;license&quot;: &quot;ISC&quot;,
  &quot;dependencies&quot;: {
    &quot;@answerrocket/iterable-map&quot;: &quot;file:Core/packages/iterable-map&quot;,
    &quot;@answerrocket/itertools&quot;: &quot;file:Core/packages/itertools&quot;,
    &quot;@answerrocket/organizer&quot;: &quot;file:Core/packages/organizer&quot;,
    &quot;@babel/plugin-proposal-class-properties&quot;: &quot;^7.4.0&quot;,
    &quot;@babel/plugin-proposal-export-default-from&quot;: &quot;^7.2.0&quot;,
    &quot;@babel/plugin-transform-classes&quot;: &quot;^7.4.3&quot;,
    &quot;@babel/plugin-transform-runtime&quot;: &quot;^7.4.3&quot;,
    &quot;@babel/runtime&quot;: &quot;^7.4.3&quot;,
    &quot;catalog&quot;: &quot;^3.6.0&quot;,
    &quot;fetch-intercept&quot;: &quot;^2.3.1&quot;,
    &quot;lodash&quot;: &quot;^4.17.11&quot;,
    &quot;lodash-es&quot;: &quot;^4.17.11&quot;,
    &quot;moment&quot;: &quot;^2.24.0&quot;,
    &quot;plotly.js&quot;: &quot;^1.47.2&quot;,
    &quot;react&quot;: &quot;^16.8.6&quot;,
    &quot;react-dom&quot;: &quot;^16.8.6&quot;,
    &quot;react-plotly.js&quot;: &quot;^2.3.0&quot;,
    &quot;react-router&quot;: &quot;^5.0.0&quot;,
    &quot;react-router-dom&quot;: &quot;^5.0.0&quot;,
    &quot;react-scripts&quot;: &quot;2.1.8&quot;,
    &quot;ts-optchain&quot;: &quot;^0.1.5&quot;,
    &quot;typescript&quot;: &quot;^3.4.3&quot;,
    &quot;vega&quot;: &quot;^5.3.5&quot;,
    &quot;vega-embed&quot;: &quot;^4.0.0&quot;,
    &quot;vega-lite&quot;: &quot;^3.1.0&quot;
  },
  &quot;devDependencies&quot;: {
    &quot;@types/lodash-es&quot;: &quot;^4.17.3&quot;,
    &quot;@types/plotly.js&quot;: &quot;^1.44.3&quot;,
    &quot;@types/react&quot;: &quot;^16.8.13&quot;,
    &quot;@types/react-plotly.js&quot;: &quot;^2.2.2&quot;,
    &quot;@types/react-router-dom&quot;: &quot;^4.3.2&quot;,
    &quot;@babel/preset-typescript&quot;: &quot;^7.3.3&quot;,
    &quot;babel&quot;: &quot;^6.23.0&quot;,
    &quot;babel-core&quot;: &quot;^6.26.3&quot;,
    &quot;babel-loader&quot;: &quot;^8.0.5&quot;,
    &quot;babel-preset-env&quot;: &quot;^1.7.0&quot;,
    &quot;babel-preset-react&quot;: &quot;^6.24.1&quot;,
    &quot;html-webpack-plugin&quot;: &quot;^3.2.0&quot;,
    &quot;http-server&quot;: &quot;^0.11.1&quot;,
    &quot;webpack&quot;: &quot;^4.29.6&quot;,
    &quot;webpack-cli&quot;: &quot;^3.3.0&quot;,
    &quot;webpack-dev-server&quot;: &quot;^3.3.1&quot;
  }
}


webpack.config.js

const path = require(&quot;path&quot;);
const HtmlWebPackPlugin = require(&quot;html-webpack-plugin&quot;);
const ExtractTextPlugin = require(&quot;extract-text-webpack-plugin&quot;);

const esDepIncludes =  [/\/@customePackage\//]

module.exports = {
    devtool: 'source-map',
    entry: './src/index.tsx',
    output: {
        path: path.join(__dirname, &quot;/dist&quot;),
        publicPath: &quot;/dist/&quot;,
        filename: &quot;bundle.js&quot;
    },
    module: {
        rules: [
            {
                test: /\.(js|ts|tsx)$/,
                exclude: /node_modules/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        presets: ['@babel/preset-react']
                    }
                }
            },
            {
                test: /\.[jt]sx?$/,
                include: esDepIncludes,
                loader: 'babel-loader',
            },
            {
                test: /\.(png|jpg|gif)$/,
                use: [
                    {
                        loader: 'file-loader'
                    }
                ]
            }
        ]
    },
    resolve: {
        extensions: [&quot;*&quot;, &quot;.js&quot;, &quot;.jsx&quot;, &quot;.tsx&quot;, &quot;.ts&quot;],
        modules: [
            path.join(__dirname, 'src'),
            path.join(__dirname, 'private_modules'),
            'node_modules'
        ],},
    plugins: [
        new HtmlWebPackPlugin({
            hash: true,
            filename: &quot;index.tsx.ysx.jsx.html&quot;,  //target html
            template: &quot;./public/index.html&quot; //source html
        })
    ]
}
"><pre class="notranslate"><span class="pl-s1">babel</span><span class="pl-kos">.</span><span class="pl-c1">config</span><span class="pl-kos">.</span><span class="pl-c1">js</span>
<span class="pl-k">const</span> <span class="pl-c1">DEVELOPMENT</span> <span class="pl-c1">=</span> <span class="pl-s">'production'</span> <span class="pl-c1">!==</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">NODE_ENV</span>

<span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
    <span class="pl-c1">presets</span>: <span class="pl-kos">[</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/preset-env"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-c1">useBuiltIns</span>: <span class="pl-s">"entry"</span><span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/preset-react"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/typescript"</span>
    <span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-c1">plugins</span>: <span class="pl-kos">[</span>
        <span class="pl-s">"@babel/plugin-proposal-class-properties"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-proposal-export-default-from"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-syntax-dynamic-import"</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-transform-runtime"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">"regenerator"</span>: <span class="pl-c1">true</span><span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/plugin-transform-classes"</span><span class="pl-kos">,</span>
    <span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span>

<span class="pl-s1">package</span><span class="pl-kos">.</span><span class="pl-c1">json</span>
<span class="pl-kos">{</span>
  <span class="pl-s">"name"</span>: <span class="pl-s">"webclient2.1"</span><span class="pl-kos">,</span>
  <span class="pl-s">"version"</span>: <span class="pl-s">"1.0.0"</span><span class="pl-kos">,</span>
  <span class="pl-s">"description"</span>: <span class="pl-s">""</span><span class="pl-kos">,</span>
  <span class="pl-s">"main"</span>: <span class="pl-s">"index.js"</span><span class="pl-kos">,</span>
  <span class="pl-s">"scripts"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"test"</span>: <span class="pl-s">"echo \"Error: no test specified\" &amp;&amp; exit 1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"start"</span>: <span class="pl-s">"node_modules/.bin/webpack-dev-server --mode development --open --hot"</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s">"author"</span>: <span class="pl-s">""</span><span class="pl-kos">,</span>
  <span class="pl-s">"license"</span>: <span class="pl-s">"ISC"</span><span class="pl-kos">,</span>
  <span class="pl-s">"dependencies"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"@answerrocket/iterable-map"</span>: <span class="pl-s">"file:Core/packages/iterable-map"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@answerrocket/itertools"</span>: <span class="pl-s">"file:Core/packages/itertools"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@answerrocket/organizer"</span>: <span class="pl-s">"file:Core/packages/organizer"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/plugin-proposal-class-properties"</span>: <span class="pl-s">"^7.4.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/plugin-proposal-export-default-from"</span>: <span class="pl-s">"^7.2.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/plugin-transform-classes"</span>: <span class="pl-s">"^7.4.3"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/plugin-transform-runtime"</span>: <span class="pl-s">"^7.4.3"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/runtime"</span>: <span class="pl-s">"^7.4.3"</span><span class="pl-kos">,</span>
    <span class="pl-s">"catalog"</span>: <span class="pl-s">"^3.6.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"fetch-intercept"</span>: <span class="pl-s">"^2.3.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"lodash"</span>: <span class="pl-s">"^4.17.11"</span><span class="pl-kos">,</span>
    <span class="pl-s">"lodash-es"</span>: <span class="pl-s">"^4.17.11"</span><span class="pl-kos">,</span>
    <span class="pl-s">"moment"</span>: <span class="pl-s">"^2.24.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"plotly.js"</span>: <span class="pl-s">"^1.47.2"</span><span class="pl-kos">,</span>
    <span class="pl-s">"react"</span>: <span class="pl-s">"^16.8.6"</span><span class="pl-kos">,</span>
    <span class="pl-s">"react-dom"</span>: <span class="pl-s">"^16.8.6"</span><span class="pl-kos">,</span>
    <span class="pl-s">"react-plotly.js"</span>: <span class="pl-s">"^2.3.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"react-router"</span>: <span class="pl-s">"^5.0.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"react-router-dom"</span>: <span class="pl-s">"^5.0.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"react-scripts"</span>: <span class="pl-s">"2.1.8"</span><span class="pl-kos">,</span>
    <span class="pl-s">"ts-optchain"</span>: <span class="pl-s">"^0.1.5"</span><span class="pl-kos">,</span>
    <span class="pl-s">"typescript"</span>: <span class="pl-s">"^3.4.3"</span><span class="pl-kos">,</span>
    <span class="pl-s">"vega"</span>: <span class="pl-s">"^5.3.5"</span><span class="pl-kos">,</span>
    <span class="pl-s">"vega-embed"</span>: <span class="pl-s">"^4.0.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"vega-lite"</span>: <span class="pl-s">"^3.1.0"</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s">"devDependencies"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"@types/lodash-es"</span>: <span class="pl-s">"^4.17.3"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@types/plotly.js"</span>: <span class="pl-s">"^1.44.3"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@types/react"</span>: <span class="pl-s">"^16.8.13"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@types/react-plotly.js"</span>: <span class="pl-s">"^2.2.2"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@types/react-router-dom"</span>: <span class="pl-s">"^4.3.2"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/preset-typescript"</span>: <span class="pl-s">"^7.3.3"</span><span class="pl-kos">,</span>
    <span class="pl-s">"babel"</span>: <span class="pl-s">"^6.23.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"babel-core"</span>: <span class="pl-s">"^6.26.3"</span><span class="pl-kos">,</span>
    <span class="pl-s">"babel-loader"</span>: <span class="pl-s">"^8.0.5"</span><span class="pl-kos">,</span>
    <span class="pl-s">"babel-preset-env"</span>: <span class="pl-s">"^1.7.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"babel-preset-react"</span>: <span class="pl-s">"^6.24.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"html-webpack-plugin"</span>: <span class="pl-s">"^3.2.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"http-server"</span>: <span class="pl-s">"^0.11.1"</span><span class="pl-kos">,</span>
    <span class="pl-s">"webpack"</span>: <span class="pl-s">"^4.29.6"</span><span class="pl-kos">,</span>
    <span class="pl-s">"webpack-cli"</span>: <span class="pl-s">"^3.3.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"webpack-dev-server"</span>: <span class="pl-s">"^3.3.1"</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span>


<span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">config</span><span class="pl-kos">.</span><span class="pl-c1">js</span>

<span class="pl-k">const</span> <span class="pl-s1">path</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"path"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-v">HtmlWebPackPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"html-webpack-plugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-v">ExtractTextPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"extract-text-webpack-plugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-s1">esDepIncludes</span> <span class="pl-c1">=</span>  <span class="pl-kos">[</span><span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\/</span>@customePackage<span class="pl-cce">\/</span><span class="pl-c1">/</span></span><span class="pl-kos">]</span>

<span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
    <span class="pl-c1">devtool</span>: <span class="pl-s">'source-map'</span><span class="pl-kos">,</span>
    <span class="pl-c1">entry</span>: <span class="pl-s">'./src/index.tsx'</span><span class="pl-kos">,</span>
    <span class="pl-c1">output</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">path</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">"/dist"</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-c1">publicPath</span>: <span class="pl-s">"/dist/"</span><span class="pl-kos">,</span>
        <span class="pl-c1">filename</span>: <span class="pl-s">"bundle.js"</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-c1">module</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">rules</span>: <span class="pl-kos">[</span>
            <span class="pl-kos">{</span>
                <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span><span class="pl-kos">(</span>js<span class="pl-c1">|</span>ts<span class="pl-c1">|</span>tsx<span class="pl-kos">)</span><span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
                <span class="pl-c1">exclude</span>: <span class="pl-pds"><span class="pl-c1">/</span>node_modules<span class="pl-c1">/</span></span><span class="pl-kos">,</span>
                <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
                    <span class="pl-c1">loader</span>: <span class="pl-s">'babel-loader'</span><span class="pl-kos">,</span>
                    <span class="pl-c1">options</span>: <span class="pl-kos">{</span>
                        <span class="pl-c1">presets</span>: <span class="pl-kos">[</span><span class="pl-s">'@babel/preset-react'</span><span class="pl-kos">]</span>
                    <span class="pl-kos">}</span>
                <span class="pl-kos">}</span>
            <span class="pl-kos">}</span><span class="pl-kos">,</span>
            <span class="pl-kos">{</span>
                <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span><span class="pl-kos">[</span>jt<span class="pl-kos">]</span>sx?<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
                <span class="pl-c1">include</span>: <span class="pl-s1">esDepIncludes</span><span class="pl-kos">,</span>
                <span class="pl-c1">loader</span>: <span class="pl-s">'babel-loader'</span><span class="pl-kos">,</span>
            <span class="pl-kos">}</span><span class="pl-kos">,</span>
            <span class="pl-kos">{</span>
                <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span><span class="pl-kos">(</span>png<span class="pl-c1">|</span>jpg<span class="pl-c1">|</span>gif<span class="pl-kos">)</span><span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
                <span class="pl-c1">use</span>: <span class="pl-kos">[</span>
                    <span class="pl-kos">{</span>
                        <span class="pl-c1">loader</span>: <span class="pl-s">'file-loader'</span>
                    <span class="pl-kos">}</span>
                <span class="pl-kos">]</span>
            <span class="pl-kos">}</span>
        <span class="pl-kos">]</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-c1">resolve</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">extensions</span>: <span class="pl-kos">[</span><span class="pl-s">"*"</span><span class="pl-kos">,</span> <span class="pl-s">".js"</span><span class="pl-kos">,</span> <span class="pl-s">".jsx"</span><span class="pl-kos">,</span> <span class="pl-s">".tsx"</span><span class="pl-kos">,</span> <span class="pl-s">".ts"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-c1">modules</span>: <span class="pl-kos">[</span>
            <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'src'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
            <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'private_modules'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
            <span class="pl-s">'node_modules'</span>
        <span class="pl-kos">]</span><span class="pl-kos">,</span><span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-c1">plugins</span>: <span class="pl-kos">[</span>
        <span class="pl-k">new</span> <span class="pl-v">HtmlWebPackPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
            <span class="pl-c1">hash</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
            <span class="pl-c1">filename</span>: <span class="pl-s">"index.tsx.ysx.jsx.html"</span><span class="pl-kos">,</span>  <span class="pl-c">//target html</span>
            <span class="pl-c1">template</span>: <span class="pl-s">"./public/index.html"</span> <span class="pl-c">//source html</span>
        <span class="pl-kos">}</span><span class="pl-kos">)</span>
    <span class="pl-kos">]</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): v6.23.0</li>
<li>Node/npm version: Node 10/npm 6.4.1</li>
<li>OS: OSX 10.14.4</li>
<li>Monorepo: [e.g. yes/no/Lerna]</li>
<li>How you are using Babel: webpack</li>
</ul>
<p dir="auto"><strong>Possible Solution</strong><br>
So far I haven't found a way around this</p>
<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
When a class (B) extends another class (A) and includes a type definition to narrow the type of something specified in class A, it will set the narrowed property's value to undefined. This diverges from the TSC behavior.<br>
The output from the below code under babel is <code class="notranslate">a, undefined</code>.<br>
<strong>Input Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  class A {
    value: any
    constructor(value: any) {
      this.value = value
    }
  }

  class B extends A {
    value: string
  }

document.write(`${new A('a').value}, ${new B('b').value}`)"><pre class="notranslate">  <span class="pl-k">class</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
    <span class="pl-c1">value</span>: <span class="pl-smi">any</span>
    <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-s1">value</span>: <span class="pl-smi">any</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-s1">value</span>
    <span class="pl-kos">}</span>
  <span class="pl-kos">}</span>

  <span class="pl-k">class</span> <span class="pl-smi">B</span> <span class="pl-k">extends</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
    <span class="pl-c1">value</span>: <span class="pl-smi">string</span>
  <span class="pl-kos">}</span>

<span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">write</span><span class="pl-kos">(</span><span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-k">new</span> <span class="pl-smi">A</span><span class="pl-kos">(</span><span class="pl-s">'a'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">}</span></span>, <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-k">new</span> <span class="pl-smi">B</span><span class="pl-kos">(</span><span class="pl-s">'b'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
The output from the code should be <code class="notranslate">a, b</code>.</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<p dir="auto">.babelrc:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;presets&quot;: [
    &quot;@babel/env&quot;,
    &quot;@babel/typescript&quot;
  ],
  &quot;plugins&quot;: [
    &quot;@babel/proposal-class-properties&quot;,
    &quot;@babel/proposal-object-rest-spread&quot;
  ]
}"><pre class="notranslate"><span class="pl-kos">{</span>
  <span class="pl-s">"presets"</span>: <span class="pl-kos">[</span>
    <span class="pl-s">"@babel/env"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/typescript"</span>
  <span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-s">"plugins"</span>: <span class="pl-kos">[</span>
    <span class="pl-s">"@babel/proposal-class-properties"</span><span class="pl-kos">,</span>
    <span class="pl-s">"@babel/proposal-object-rest-spread"</span>
  <span class="pl-kos">]</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): 7.1.6</li>
<li>Node/npm version: Node 10 / NPM 6</li>
<li>OS: Any OS</li>
<li>Monorepo: doesn't matter</li>
<li>How you are using Babel: loader</li>
</ul>
<p dir="auto"><strong>Possible Solution</strong><br>
It seems like babel is setting <code class="notranslate">value = undefined</code> in the class property - it needs to check if that value is defined in the parent before overwriting it.</p>