Clean up template calls.
This commit is contained in:
@@ -72,7 +72,7 @@ export default function(path, helpers) {
|
||||
OBJECT: node.right,
|
||||
STEP_VALUE: stepValue,
|
||||
STEP_KEY: stepKey,
|
||||
AWAIT: helpers.wrapAwait,
|
||||
...(helpers.wrapAwait ? { AWAIT: helpers.wrapAwait } : {}),
|
||||
});
|
||||
|
||||
// remove generator function wrapper
|
||||
|
||||
@@ -245,7 +245,6 @@ export default function({ template, types: t }, options) {
|
||||
ITERATOR_KEY: iteratorKey,
|
||||
STEP_KEY: stepKey,
|
||||
OBJECT: node.right,
|
||||
BODY: null,
|
||||
});
|
||||
|
||||
const isLabeledParent = t.isLabeledStatement(parent);
|
||||
|
||||
@@ -37,23 +37,16 @@ export default function({ types: t }, options) {
|
||||
});
|
||||
|
||||
const amdArgs = [];
|
||||
const commonjsArgs = [];
|
||||
const importNames = [];
|
||||
|
||||
if (hasExports(meta)) {
|
||||
amdArgs.push(t.stringLiteral("exports"));
|
||||
commonjsArgs.push(t.identifier("exports"));
|
||||
|
||||
importNames.push(t.identifier(meta.exportName));
|
||||
}
|
||||
|
||||
for (const [source, metadata] of meta.source) {
|
||||
amdArgs.push(t.stringLiteral(source));
|
||||
commonjsArgs.push(
|
||||
t.callExpression(t.identifier("require"), [
|
||||
t.stringLiteral(source),
|
||||
]),
|
||||
);
|
||||
importNames.push(t.identifier(metadata.name));
|
||||
|
||||
if (!isSideEffectImport(metadata)) {
|
||||
@@ -89,7 +82,6 @@ export default function({ types: t }, options) {
|
||||
MODULE_NAME: moduleName,
|
||||
|
||||
AMD_ARGUMENTS: t.arrayExpression(amdArgs),
|
||||
COMMONJS_ARGUMENTS: commonjsArgs,
|
||||
IMPORT_NAMES: importNames,
|
||||
}),
|
||||
])[0];
|
||||
|
||||
Reference in New Issue
Block a user