mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-21 03:55:23 -04:00
Fix the error when the statestyles attribute is empty Signed-off-by: jiangbo <jiangbo91@huawei.com> Change-Id: I84a9207cfec59f5a58c4154c20abc65d792ef6de
This commit is contained in:
@@ -1181,7 +1181,9 @@ function traverseStateStylesAttr(temp: any, statements: ts.Statement[],
|
||||
bindComponentAttr(ts.factory.createExpressionStatement(
|
||||
item.initializer.properties[0].initializer), identifierNode, statements, log, false, true);
|
||||
} else {
|
||||
validateStateStyleSyntax(item, temp, log);
|
||||
if (!(ts.isObjectLiteralExpression(item.initializer) && item.initializer.properties.length === 0)) {
|
||||
validateStateStyleSyntax(temp, log);
|
||||
}
|
||||
}
|
||||
if (item.name) {
|
||||
statements.push(createViewStackProcessor(item, false));
|
||||
@@ -1367,14 +1369,12 @@ function getComponentType(node: ts.ExpressionStatement, log: LogInfo[],
|
||||
return null;
|
||||
}
|
||||
|
||||
export function validateStateStyleSyntax(item: ts.PropertyAssignment, temp: any, log: LogInfo[]): void {
|
||||
if (!(ts.isObjectLiteralExpression(item.initializer) && item.initializer.properties.length === 0)) {
|
||||
log.push({
|
||||
type: LogType.ERROR,
|
||||
message: `.stateStyles doesn't conform standard.`,
|
||||
pos: temp.getStart()
|
||||
});
|
||||
}
|
||||
export function validateStateStyleSyntax(temp: any, log: LogInfo[]): void {
|
||||
log.push({
|
||||
type: LogType.ERROR,
|
||||
message: `.stateStyles doesn't conform standard.`,
|
||||
pos: temp.getStart()
|
||||
});
|
||||
}
|
||||
|
||||
function getEtsComponentExpression(node:ts.ExpressionStatement): ts.EtsComponentExpression {
|
||||
|
||||
Reference in New Issue
Block a user