jiangbo91huawei.com

修复@Builder函数未识别自定义组件尾随闭包

Signed-off-by: BoJiang <jiangbo91@huawei.com>
Change-Id: I2c0bb651f9285ab788f8eae02dbe3210b0370cc2
This commit is contained in:
BoJiang 2024-07-30 17:08:35 +08:00
parent 4b8307cea2
commit 534a0bf084
7 changed files with 21 additions and 0 deletions

View File

@ -30810,7 +30810,9 @@ var ts;
if (name && ts.hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
fileStylesComponents.set(name.escapedText.toString(), 262);
}
var originalUICallbackContext = inUICallbackContext();
setEtsBuilderContext(ts.hasEtsBuilderDecoratorNames(decorators, sourceFileCompilerOptions));
setUICallbackContext(inBuilderContext());
var isGenerator = asteriskToken ? 1 : 0;
var isAsync = modifierFlags & 512 ? 2 : 0;
var typeParameters = inEtsStylesComponentsContext() && stylesEtsComponentDeclaration ? parseEtsTypeParameters(scanner.getStartPos()) : parseTypeParameters();
@ -30821,6 +30823,7 @@ var ts;
var type = getFunctionDeclarationReturnType();
var body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, ts.Diagnostics.or_expected);
setEtsBuilderContext(false);
setUICallbackContext(originalUICallbackContext);
setEtsExtendComponentsContext(false);
extendEtsComponentDeclaration = undefined;
setEtsStylesComponentsContext(false);

View File

@ -38024,7 +38024,9 @@ var ts;
if (name && ts.hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
fileStylesComponents.set(name.escapedText.toString(), 262 /* SyntaxKind.FunctionDeclaration */);
}
var originalUICallbackContext = inUICallbackContext();
setEtsBuilderContext(ts.hasEtsBuilderDecoratorNames(decorators, sourceFileCompilerOptions));
setUICallbackContext(inBuilderContext());
var isGenerator = asteriskToken ? 1 /* SignatureFlags.Yield */ : 0 /* SignatureFlags.None */;
var isAsync = modifierFlags & 512 /* ModifierFlags.Async */ ? 2 /* SignatureFlags.Await */ : 0 /* SignatureFlags.None */;
var typeParameters = inEtsStylesComponentsContext() && stylesEtsComponentDeclaration ? parseEtsTypeParameters(scanner.getStartPos()) : parseTypeParameters();
@ -38035,6 +38037,7 @@ var ts;
var type = getFunctionDeclarationReturnType();
var body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, ts.Diagnostics.or_expected);
setEtsBuilderContext(false);
setUICallbackContext(originalUICallbackContext);
setEtsExtendComponentsContext(false);
extendEtsComponentDeclaration = undefined;
setEtsStylesComponentsContext(false);

View File

@ -38023,7 +38023,9 @@ var ts;
if (name && ts.hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
fileStylesComponents.set(name.escapedText.toString(), 262 /* SyntaxKind.FunctionDeclaration */);
}
var originalUICallbackContext = inUICallbackContext();
setEtsBuilderContext(ts.hasEtsBuilderDecoratorNames(decorators, sourceFileCompilerOptions));
setUICallbackContext(inBuilderContext());
var isGenerator = asteriskToken ? 1 /* SignatureFlags.Yield */ : 0 /* SignatureFlags.None */;
var isAsync = modifierFlags & 512 /* ModifierFlags.Async */ ? 2 /* SignatureFlags.Await */ : 0 /* SignatureFlags.None */;
var typeParameters = inEtsStylesComponentsContext() && stylesEtsComponentDeclaration ? parseEtsTypeParameters(scanner.getStartPos()) : parseTypeParameters();
@ -38034,6 +38036,7 @@ var ts;
var type = getFunctionDeclarationReturnType();
var body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, ts.Diagnostics.or_expected);
setEtsBuilderContext(false);
setUICallbackContext(originalUICallbackContext);
setEtsExtendComponentsContext(false);
extendEtsComponentDeclaration = undefined;
setEtsStylesComponentsContext(false);

View File

@ -38014,7 +38014,9 @@ var ts;
if (name && ts.hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
fileStylesComponents.set(name.escapedText.toString(), 262 /* SyntaxKind.FunctionDeclaration */);
}
var originalUICallbackContext = inUICallbackContext();
setEtsBuilderContext(ts.hasEtsBuilderDecoratorNames(decorators, sourceFileCompilerOptions));
setUICallbackContext(inBuilderContext());
var isGenerator = asteriskToken ? 1 /* SignatureFlags.Yield */ : 0 /* SignatureFlags.None */;
var isAsync = modifierFlags & 512 /* ModifierFlags.Async */ ? 2 /* SignatureFlags.Await */ : 0 /* SignatureFlags.None */;
var typeParameters = inEtsStylesComponentsContext() && stylesEtsComponentDeclaration ? parseEtsTypeParameters(scanner.getStartPos()) : parseTypeParameters();
@ -38025,6 +38027,7 @@ var ts;
var type = getFunctionDeclarationReturnType();
var body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, ts.Diagnostics.or_expected);
setEtsBuilderContext(false);
setUICallbackContext(originalUICallbackContext);
setEtsExtendComponentsContext(false);
extendEtsComponentDeclaration = undefined;
setEtsStylesComponentsContext(false);

View File

@ -38014,7 +38014,9 @@ var ts;
if (name && ts.hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
fileStylesComponents.set(name.escapedText.toString(), 262 /* SyntaxKind.FunctionDeclaration */);
}
var originalUICallbackContext = inUICallbackContext();
setEtsBuilderContext(ts.hasEtsBuilderDecoratorNames(decorators, sourceFileCompilerOptions));
setUICallbackContext(inBuilderContext());
var isGenerator = asteriskToken ? 1 /* SignatureFlags.Yield */ : 0 /* SignatureFlags.None */;
var isAsync = modifierFlags & 512 /* ModifierFlags.Async */ ? 2 /* SignatureFlags.Await */ : 0 /* SignatureFlags.None */;
var typeParameters = inEtsStylesComponentsContext() && stylesEtsComponentDeclaration ? parseEtsTypeParameters(scanner.getStartPos()) : parseTypeParameters();
@ -38025,6 +38027,7 @@ var ts;
var type = getFunctionDeclarationReturnType();
var body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, ts.Diagnostics.or_expected);
setEtsBuilderContext(false);
setUICallbackContext(originalUICallbackContext);
setEtsExtendComponentsContext(false);
extendEtsComponentDeclaration = undefined;
setEtsStylesComponentsContext(false);

View File

@ -38004,7 +38004,9 @@ var ts;
if (name && ts.hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
fileStylesComponents.set(name.escapedText.toString(), 262 /* SyntaxKind.FunctionDeclaration */);
}
var originalUICallbackContext = inUICallbackContext();
setEtsBuilderContext(ts.hasEtsBuilderDecoratorNames(decorators, sourceFileCompilerOptions));
setUICallbackContext(inBuilderContext());
var isGenerator = asteriskToken ? 1 /* SignatureFlags.Yield */ : 0 /* SignatureFlags.None */;
var isAsync = modifierFlags & 512 /* ModifierFlags.Async */ ? 2 /* SignatureFlags.Await */ : 0 /* SignatureFlags.None */;
var typeParameters = inEtsStylesComponentsContext() && stylesEtsComponentDeclaration ? parseEtsTypeParameters(scanner.getStartPos()) : parseTypeParameters();
@ -38015,6 +38017,7 @@ var ts;
var type = getFunctionDeclarationReturnType();
var body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, ts.Diagnostics.or_expected);
setEtsBuilderContext(false);
setUICallbackContext(originalUICallbackContext);
setEtsExtendComponentsContext(false);
extendEtsComponentDeclaration = undefined;
setEtsStylesComponentsContext(false);

View File

@ -7424,7 +7424,9 @@ namespace ts {
if(name && hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) {
fileStylesComponents.set(name.escapedText.toString(), SyntaxKind.FunctionDeclaration);
}
const originalUICallbackContext = inUICallbackContext();
setEtsBuilderContext(hasEtsBuilderDecoratorNames(decorators, sourceFileCompilerOptions));
setUICallbackContext(inBuilderContext());
const isGenerator = asteriskToken ? SignatureFlags.Yield : SignatureFlags.None;
const isAsync = modifierFlags & ModifierFlags.Async ? SignatureFlags.Await : SignatureFlags.None;
const typeParameters = inEtsStylesComponentsContext() && stylesEtsComponentDeclaration ? parseEtsTypeParameters(scanner.getStartPos()) : parseTypeParameters();
@ -7434,6 +7436,7 @@ namespace ts {
const type = getFunctionDeclarationReturnType();
const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, Diagnostics.or_expected);
setEtsBuilderContext(false);
setUICallbackContext(originalUICallbackContext);
setEtsExtendComponentsContext(false);
extendEtsComponentDeclaration = undefined;
setEtsStylesComponentsContext(false);