From 8e10487de564bf660459f6dd11215aa7316a8506 Mon Sep 17 00:00:00 2001 From: jiangbo Date: Thu, 30 Jun 2022 17:04:16 +0800 Subject: [PATCH 1/7] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix装饰器属性名与内置属性名重名异常报错 Signed-off-by: jiangbo --- compiler/src/process_component_build.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 0cebbd2..1bc136d 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1284,7 +1284,7 @@ export function getName(node: ts.ExpressionStatement | ts.Expression): string { name = temp.escapedText.toString(); break; } else if (ts.isPropertyAccessExpression(temp) && temp.name && ts.isIdentifier(temp.name) && - !BUILDIN_STYLE_NAMES.has(temp.name.escapedText.toString())) { + isDecoratedAttributeName(temp)) { name = temp.name.escapedText.toString(); break; } @@ -1292,6 +1292,14 @@ export function getName(node: ts.ExpressionStatement | ts.Expression): string { } return name; } +function isDecoratedAttributeName(temp: ts.PropertyAccessExpression): boolean { + if (temp.expression && temp.expression.getText() === THIS) { + return true; + } else { + return !BUILDIN_STYLE_NAMES.has(temp.name.escapedText.toString()); + } +} + export function isAttributeNode(node: ts.ExpressionStatement): boolean { let temp: any = node.expression; From 54627cc61baaf08da4a70b807df0eb6917bb871f Mon Sep 17 00:00:00 2001 From: jiangbo Date: Thu, 30 Jun 2022 17:06:45 +0800 Subject: [PATCH 2/7] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 代码间距 Signed-off-by: jiangbo --- compiler/src/process_component_build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 1bc136d..0364305 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1292,6 +1292,7 @@ export function getName(node: ts.ExpressionStatement | ts.Expression): string { } return name; } + function isDecoratedAttributeName(temp: ts.PropertyAccessExpression): boolean { if (temp.expression && temp.expression.getText() === THIS) { return true; @@ -1300,7 +1301,6 @@ function isDecoratedAttributeName(temp: ts.PropertyAccessExpression): boolean { } } - export function isAttributeNode(node: ts.ExpressionStatement): boolean { let temp: any = node.expression; let name: string; From accc15e50940330399234d5ecd91c0438c8f55dd Mon Sep 17 00:00:00 2001 From: jiangbo Date: Thu, 30 Jun 2022 17:08:33 +0800 Subject: [PATCH 3/7] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 代码规范化 Signed-off-by: jiangbo --- compiler/src/process_component_build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 0364305..5b6a606 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1284,7 +1284,7 @@ export function getName(node: ts.ExpressionStatement | ts.Expression): string { name = temp.escapedText.toString(); break; } else if (ts.isPropertyAccessExpression(temp) && temp.name && ts.isIdentifier(temp.name) && - isDecoratedAttributeName(temp)) { + isDecoratedAttributeName(temp)) { name = temp.name.escapedText.toString(); break; } From 1aa900ae7ed3b13409ee2268150638f2f5f51586 Mon Sep 17 00:00:00 2001 From: jiangbo Date: Thu, 30 Jun 2022 17:50:29 +0800 Subject: [PATCH 4/7] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 函数名称修改 Signed-off-by: jiangbo --- compiler/src/process_component_build.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 5b6a606..ab5837a 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1284,7 +1284,7 @@ export function getName(node: ts.ExpressionStatement | ts.Expression): string { name = temp.escapedText.toString(); break; } else if (ts.isPropertyAccessExpression(temp) && temp.name && ts.isIdentifier(temp.name) && - isDecoratedAttributeName(temp)) { + isBuildStyleNames(temp)) { name = temp.name.escapedText.toString(); break; } @@ -1293,7 +1293,7 @@ export function getName(node: ts.ExpressionStatement | ts.Expression): string { return name; } -function isDecoratedAttributeName(temp: ts.PropertyAccessExpression): boolean { +function isBuildStyleNames(temp: ts.PropertyAccessExpression): boolean { if (temp.expression && temp.expression.getText() === THIS) { return true; } else { From ed2ffda1744527d378cb9c441cc8e707246f9d11 Mon Sep 17 00:00:00 2001 From: jiangbo Date: Thu, 30 Jun 2022 18:09:13 +0800 Subject: [PATCH 5/7] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 函数名修改 Signed-off-by: jiangbo --- compiler/src/process_component_build.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index ab5837a..a6bca5e 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1284,7 +1284,7 @@ export function getName(node: ts.ExpressionStatement | ts.Expression): string { name = temp.escapedText.toString(); break; } else if (ts.isPropertyAccessExpression(temp) && temp.name && ts.isIdentifier(temp.name) && - isBuildStyleNames(temp)) { + notPropertyAccessExpressionName(temp)) { name = temp.name.escapedText.toString(); break; } @@ -1293,7 +1293,7 @@ export function getName(node: ts.ExpressionStatement | ts.Expression): string { return name; } -function isBuildStyleNames(temp: ts.PropertyAccessExpression): boolean { +function notPropertyAccessExpressionName(temp: ts.PropertyAccessExpression): boolean { if (temp.expression && temp.expression.getText() === THIS) { return true; } else { From c5304ded46ae75332acf5789e55181d93a0e43af Mon Sep 17 00:00:00 2001 From: jiangbo Date: Thu, 30 Jun 2022 18:36:50 +0800 Subject: [PATCH 6/7] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 函数名称修改 Signed-off-by: jiangbo --- compiler/src/process_component_build.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index a6bca5e..16f9119 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1284,7 +1284,7 @@ export function getName(node: ts.ExpressionStatement | ts.Expression): string { name = temp.escapedText.toString(); break; } else if (ts.isPropertyAccessExpression(temp) && temp.name && ts.isIdentifier(temp.name) && - notPropertyAccessExpressionName(temp)) { + isCustomAttributes(temp)) { name = temp.name.escapedText.toString(); break; } @@ -1293,7 +1293,7 @@ export function getName(node: ts.ExpressionStatement | ts.Expression): string { return name; } -function notPropertyAccessExpressionName(temp: ts.PropertyAccessExpression): boolean { +function isCustomAttributes(temp: ts.PropertyAccessExpression): boolean { if (temp.expression && temp.expression.getText() === THIS) { return true; } else { From 84a7c1a77e5d77bef32b1cd98f366858238266e0 Mon Sep 17 00:00:00 2001 From: jiangbo Date: Thu, 30 Jun 2022 18:38:08 +0800 Subject: [PATCH 7/7] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 代码规范化 Signed-off-by: jiangbo --- compiler/src/process_component_build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 16f9119..91738cf 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1284,7 +1284,7 @@ export function getName(node: ts.ExpressionStatement | ts.Expression): string { name = temp.escapedText.toString(); break; } else if (ts.isPropertyAccessExpression(temp) && temp.name && ts.isIdentifier(temp.name) && - isCustomAttributes(temp)) { + isCustomAttributes(temp)) { name = temp.name.escapedText.toString(); break; }