Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions modules/@angular/compiler-cli/src/static_reflector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ export class StaticReflector implements ReflectorReader {
}
return result;
}
if (expression instanceof StaticSymbol) {
return expression;
}
if (expression) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this to be a separate commit. Just squash them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chuckjaz squashed 👍

if (expression['__symbolic']) {
let staticSymbol: StaticSymbol;
Expand Down
5 changes: 5 additions & 0 deletions modules/@angular/compiler-cli/test/static_reflector_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
});
Expand Down