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
@ -20,6 +20,11 @@ export interface Decorator {
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* Identifier which refers to the decorator in source.
|
||||
*/
|
||||
identifier: ts.Identifier;
|
||||
|
||||
/**
|
||||
* `Import` by which the decorator was brought into the module in which it was invoked, or `null`
|
||||
* if the decorator was declared in the same module and not imported.
|
||||
|
@ -245,6 +245,7 @@ export class TypeScriptReflectionHost implements ReflectionHost {
|
||||
|
||||
return {
|
||||
name: decoratorExpr.text,
|
||||
identifier: decoratorExpr,
|
||||
import: importDecl, node, args,
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user