fix: remove check for super in arrow function
This commit is contained in:
@@ -23,15 +23,20 @@ const noMethodVisitor = {
|
||||
};
|
||||
|
||||
const verifyConstructorVisitor = visitors.merge([noMethodVisitor, {
|
||||
Super(path) {
|
||||
Super(path, state) {
|
||||
if (
|
||||
this.isDerived && !this.hasBareSuper &&
|
||||
!path.parentPath.isCallExpression({ callee: path.node })
|
||||
!path.parentPath.isCallExpression({ callee: path.node }) &&
|
||||
!state.inArrowFunctionExpression
|
||||
) {
|
||||
throw path.buildCodeFrameError("'super.*' is not allowed before super()");
|
||||
}
|
||||
},
|
||||
|
||||
ArrowFunctionExpression(path, state) {
|
||||
state.inArrowFunctionExpression = true;
|
||||
},
|
||||
|
||||
CallExpression: {
|
||||
exit(path) {
|
||||
if (path.get("callee").isSuper()) {
|
||||
|
||||
Reference in New Issue
Block a user