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:
Alex Rickabaugh
2018-10-30 10:18:30 -07:00
committed by Matias Niemelä
parent 4dfa71f018
commit 84e311038d
3 changed files with 8 additions and 0 deletions

View File

@ -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),
});