Use literal-based templates for more stuff.
This commit is contained in:
@@ -6,12 +6,6 @@ import * as defineMap from "@babel/helper-define-map";
|
||||
import template from "@babel/template";
|
||||
import * as t from "@babel/types";
|
||||
|
||||
const buildDerivedConstructor = template(`
|
||||
(function () {
|
||||
super(...arguments);
|
||||
})
|
||||
`);
|
||||
|
||||
const noMethodVisitor = {
|
||||
"FunctionExpression|FunctionDeclaration"(path) {
|
||||
path.skip();
|
||||
@@ -212,7 +206,11 @@ export default class ClassTransformer {
|
||||
let params, body;
|
||||
|
||||
if (this.isDerived) {
|
||||
const constructor = buildDerivedConstructor().expression;
|
||||
const constructor = template.expression.ast`
|
||||
(function () {
|
||||
super(...arguments);
|
||||
})
|
||||
`;
|
||||
params = constructor.params;
|
||||
body = constructor.body;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user