Disallow duplicated AST nodes (#11807)

This commit is contained in:
Huáng Jùnliàng
2020-07-14 09:32:16 -04:00
committed by GitHub
parent ffb42488ba
commit 5dd64ecc4a
24 changed files with 85 additions and 62 deletions

View File

@@ -87,9 +87,9 @@ export default declare((api, options) => {
const lazyLoad = template.ast`
function ${templateObject}() {
const data = ${t.callExpression(helperId, callExpressionInput)};
${templateObject} = function() { return data };
${t.cloneNode(templateObject)} = function() { return data };
return data;
}
}
`;
scope.path.unshiftContainer("body", lazyLoad);