mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -05:00
Merge pull request #12740 from Microsoft/fix12727
Fix decorator emit for accessors
This commit is contained in:
@@ -1223,11 +1223,12 @@ namespace ts {
|
||||
}
|
||||
|
||||
const { firstAccessor, secondAccessor, setAccessor } = getAllAccessorDeclarations(node.members, accessor);
|
||||
if (accessor !== firstAccessor) {
|
||||
const firstAccessorWithDecorators = firstAccessor.decorators ? firstAccessor : secondAccessor && secondAccessor.decorators ? secondAccessor : undefined;
|
||||
if (!firstAccessorWithDecorators || accessor !== firstAccessorWithDecorators) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const decorators = firstAccessor.decorators || (secondAccessor && secondAccessor.decorators);
|
||||
const decorators = firstAccessorWithDecorators.decorators;
|
||||
const parameters = getDecoratorsOfParameters(setAccessor);
|
||||
if (!decorators && !parameters) {
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user