Use literal-based templates for more stuff.

This commit is contained in:
Logan Smyth
2017-10-15 18:53:53 -04:00
parent 673eaf839a
commit f230497d08
4 changed files with 82 additions and 118 deletions

View File

@@ -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 {