|
|
|
|
@ -48,8 +48,8 @@ interface ComponentOptions {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const regex_leading_directory_separator = /^[/\\]/;
|
|
|
|
|
const regex_starts_with_Export = /^Export/;
|
|
|
|
|
const regex_contains_Function = /Function/;
|
|
|
|
|
const regex_starts_with_term_export = /^Export/;
|
|
|
|
|
const regex_contains_term_function = /Function/;
|
|
|
|
|
|
|
|
|
|
export default class Component {
|
|
|
|
|
stats: Stats;
|
|
|
|
|
@ -642,7 +642,7 @@ export default class Component {
|
|
|
|
|
body.splice(i, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (regex_starts_with_Export.test(node.type)) {
|
|
|
|
|
if (regex_starts_with_term_export.test(node.type)) {
|
|
|
|
|
const replacement = this.extract_exports(node, true);
|
|
|
|
|
if (replacement) {
|
|
|
|
|
body[i] = replacement;
|
|
|
|
|
@ -799,7 +799,7 @@ export default class Component {
|
|
|
|
|
return this.skip();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (regex_starts_with_Export.test(node.type)) {
|
|
|
|
|
if (regex_starts_with_term_export.test(node.type)) {
|
|
|
|
|
const replacement = component.extract_exports(node);
|
|
|
|
|
if (replacement) {
|
|
|
|
|
this.replace(replacement);
|
|
|
|
|
@ -922,7 +922,7 @@ export default class Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (name[1] !== '$' && scope.has(name.slice(1)) && scope.find_owner(name.slice(1)) !== this.instance_scope) {
|
|
|
|
|
if (!((regex_contains_Function.test(parent.type) && prop === 'params') || (parent.type === 'VariableDeclarator' && prop === 'id'))) {
|
|
|
|
|
if (!((regex_contains_term_function.test(parent.type) && prop === 'params') || (parent.type === 'VariableDeclarator' && prop === 'id'))) {
|
|
|
|
|
return this.error(node as any, compiler_errors.contextual_store);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -969,7 +969,7 @@ export default class Component {
|
|
|
|
|
|
|
|
|
|
walk(this.ast.instance.content, {
|
|
|
|
|
enter(node: Node) {
|
|
|
|
|
if (regex_contains_Function.test(node.type)) {
|
|
|
|
|
if (regex_contains_term_function.test(node.type)) {
|
|
|
|
|
return this.skip();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|