feat(ivy): capture the identifier of a decorator during reflection (#26860)
Previously the ReflectionHost API only returned the names of decorators and not a reference to their TypeScript Identifier. This commit adds the identifier itself, so that a consumer can write references to the decorator. Testing strategy: this commit is trivial, and the functionality will be exercised by downstream tests. PR Close #26860
This commit is contained in:

committed by
Matias Niemelä

parent
4dfa71f018
commit
84e311038d
@ -572,6 +572,7 @@ export class Fesm2015ReflectionHost extends TypeScriptReflectionHost implements
|
||||
const decoratorIdentifier = decoratorExpression;
|
||||
return {
|
||||
name: decoratorIdentifier.text,
|
||||
identifier: decoratorIdentifier,
|
||||
import: this.getImportOfIdentifier(decoratorIdentifier),
|
||||
node: call,
|
||||
args: Array.from(call.arguments)
|
||||
@ -634,6 +635,7 @@ export class Fesm2015ReflectionHost extends TypeScriptReflectionHost implements
|
||||
if (typeIdentifier && ts.isIdentifier(typeIdentifier)) {
|
||||
decorators.push({
|
||||
name: typeIdentifier.text,
|
||||
identifier: typeIdentifier,
|
||||
import: this.getImportOfIdentifier(typeIdentifier), node,
|
||||
args: getDecoratorArgs(node),
|
||||
});
|
||||
|
Reference in New Issue
Block a user