fix(compiler-cli): don't clone static symbols when simplifying annotation metadata (#12158)
This commit is contained in:
parent
7787771aba
commit
8c477b2f45
|
@ -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;
|
||||
|
|
|
@ -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]);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue