Clean up template calls.

This commit is contained in:
Logan Smyth
2017-10-07 21:38:57 -04:00
parent cc22ea04bb
commit afc3963848
3 changed files with 1 additions and 10 deletions

View File

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

View File

@@ -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);

View File

@@ -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];