diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index 38f0c8ef8d0a622afd6fad45bc594c182bd788fe..9de77666ad2fe0a196751878930b1521d4b89c84 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -99,7 +99,7 @@ function checkPreview(node: ts.ClassDeclaration) { let hasPreview: boolean = false; if (node && node.decorators) { for (let i = 0; i < node.decorators.length; i++) { - const name: string = node.decorators[i].getText().replace(/\((.|\n)*\)/, '').trim(); + const name: string = node.decorators[i].getText().replace(/\([^\(\)]*\)/, '').trim(); if (name === COMPONENT_DECORATOR_PREVIEW) { hasPreview = true; break; diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 5dd4474de06c4905656f6b5f87e39dea53bcb593..7efd1f804dd3d7730390264166eb15bae41eef46 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -271,7 +271,7 @@ function checkDecorators(node: ts.MissingDeclaration | ts.ExportAssignment, resu let hasComponentDecorator: boolean = false; const componentName: string = component.getText(); node.decorators.forEach((element) => { - const name: string = element.getText().replace(/\((.|\n)*\)/, '').trim(); + const name: string = element.getText().replace(/\([^\(\)]*\)/, '').trim(); if (INNER_COMPONENT_DECORATORS.has(name)) { componentCollection.customComponents.add(componentName); switch (name) {