fix(compiler-cli): don't clone static symbols when simplifying annotation metadata (#12158)

This commit is contained in:
Steve Sewell 2016-10-11 15:47:44 -07:00 committed by Tobias Bosch
parent 7787771aba
commit 8c477b2f45
2 changed files with 8 additions and 0 deletions

View File

@ -368,6 +368,9 @@ export class StaticReflector implements ReflectorReader {
}
return result;
}
if (expression instanceof StaticSymbol) {
return expression;
}
if (expression) {
if (expression['__symbolic']) {
let staticSymbol: StaticSymbol;

View File

@ -119,6 +119,11 @@ describe('StaticReflector', () => {
expect(simplify(noContext, 'some value')).toBe('some value');
});
it('should simplify a static symbol into itself', () => {
const staticSymbol = new StaticSymbol('', '');
expect(simplify(noContext, staticSymbol)).toBe(staticSymbol);
});
it('should simplify an array into a copy of the array', () => {
expect(simplify(noContext, [1, 2, 3])).toEqual([1, 2, 3]);
});