Ensure we always push into a BlockStatement - fixes T3051
This commit is contained in:
14
packages/babel-plugin-transform-class-properties/test/fixtures/regression/T6719/actual.js
vendored
Normal file
14
packages/babel-plugin-transform-class-properties/test/fixtures/regression/T6719/actual.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
function withContext(ComposedComponent) {
|
||||
return class WithContext extends Component {
|
||||
|
||||
static propTypes = {
|
||||
context: PropTypes.shape(
|
||||
{
|
||||
addCss: PropTypes.func,
|
||||
setTitle: PropTypes.func,
|
||||
setMeta: PropTypes.func,
|
||||
}
|
||||
),
|
||||
};
|
||||
};
|
||||
}
|
||||
20
packages/babel-plugin-transform-class-properties/test/fixtures/regression/T6719/expected.js
vendored
Normal file
20
packages/babel-plugin-transform-class-properties/test/fixtures/regression/T6719/expected.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
function withContext(ComposedComponent) {
|
||||
var _class, _temp;
|
||||
|
||||
return _temp = _class = (function (_Component) {
|
||||
babelHelpers.inherits(WithContext, _Component);
|
||||
|
||||
function WithContext() {
|
||||
babelHelpers.classCallCheck(this, WithContext);
|
||||
return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(WithContext).apply(this, arguments));
|
||||
}
|
||||
|
||||
return WithContext;
|
||||
})(Component), _class.propTypes = {
|
||||
context: PropTypes.shape({
|
||||
addCss: PropTypes.func,
|
||||
setTitle: PropTypes.func,
|
||||
setMeta: PropTypes.func
|
||||
})
|
||||
}, _temp;
|
||||
}
|
||||
Reference in New Issue
Block a user