Fix: T7537 — https://phabricator.babeljs.io/T7537 When transforming super call in class constructor, part of ast is replaced using method "replaceWithMultiple" here: https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-es2015-classes/src/vanilla.js#L379 It leads to removing the node (replacing it with null) here: https://github.com/babel/babel/blob/master/packages/babel-traverse/src/path/replacement.js#L51 But parent ExpressionsStatement is still untouched and when it reaches visitor generated in here https://github.com/babel/babel/blob/master/packages/babel-helper-builder-binary-assignment-operator-visitor/src/index.js#L18 It blows up because expression is null from previous visitors.
babel-plugin-transform-es2015-classes
Compile ES2015 classes to ES5
Installation
$ npm install babel-plugin-transform-es2015-classes
Usage
Via .babelrc (Recommended)
.babelrc
// without options
{
"plugins": ["transform-es2015-classes"]
}
// with options
{
"plugins": [
["transform-es2015-classes", {
"loose": true
}]
]
}
Via CLI
$ babel --plugins transform-es2015-classes script.js
Via Node API
require("babel-core").transform("code", {
plugins: ["transform-es2015-classes"]
});