parent
40d8d9c3e3
commit
aa40366a92
|
@ -640,6 +640,9 @@ export class StaticReflector implements ReflectorReader {
|
|||
return simplifyInContext(selectContext, selectTarget[member], depth + 1);
|
||||
return null;
|
||||
case 'reference':
|
||||
if (!expression['name']) {
|
||||
return context;
|
||||
}
|
||||
if (!expression.module) {
|
||||
const name: string = expression['name'];
|
||||
const localValue = scope.resolve(name);
|
||||
|
|
|
@ -307,6 +307,12 @@ describe('StaticReflector', () => {
|
|||
.toEqual('s');
|
||||
});
|
||||
|
||||
it('should not simplify a module reference without a name', () => {
|
||||
const staticSymbol = new StaticSymbol('/src/cases', '');
|
||||
expect(simplify(staticSymbol, ({__symbolic: 'reference', module: './extern', name: ''})))
|
||||
.toEqual(staticSymbol);
|
||||
});
|
||||
|
||||
it('should simplify a non existing reference as a static symbol', () => {
|
||||
expect(simplify(
|
||||
new StaticSymbol('/src/cases', ''),
|
||||
|
|
Loading…
Reference in New Issue