From 86396a43e9a8bea335f77af1301772b72d0444a2 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Fri, 14 Apr 2017 11:19:08 -0700 Subject: [PATCH] Revert "fix(compiler): ignore calls to unresolved symbols in metadata (#15970)" This reverts commit ce47d33cd94a242f23b47f287e975c80506c9a05. --- packages/compiler/src/aot/static_reflector.ts | 2 +- .../test/aot/static_reflector_spec.ts | 24 ------------------- .../test/aot/static_symbol_resolver_spec.ts | 3 --- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/packages/compiler/src/aot/static_reflector.ts b/packages/compiler/src/aot/static_reflector.ts index 6af817f97b..bb97bd1676 100644 --- a/packages/compiler/src/aot/static_reflector.ts +++ b/packages/compiler/src/aot/static_reflector.ts @@ -601,7 +601,7 @@ export class StaticReflector implements ɵReflectorReader { case 'ignore': return expression; } - return IGNORE; + return null; } return mapStringMap(expression, (value, name) => simplify(value)); } diff --git a/packages/compiler/test/aot/static_reflector_spec.ts b/packages/compiler/test/aot/static_reflector_spec.ts index 9ea0ffda15..dd6fc683b3 100644 --- a/packages/compiler/test/aot/static_reflector_spec.ts +++ b/packages/compiler/test/aot/static_reflector_spec.ts @@ -546,30 +546,6 @@ describe('StaticReflector', () => { expect(annotation.providers).toEqual([1, 2, 3, 4, 5, 6, 7]); }); - it('should ignore unresolved calls', () => { - const data = Object.create(DEFAULT_TEST_DATA); - const file = '/tmp/src/invalid-component.ts'; - data[file] = ` - import {Component} from '@angular/core'; - import {unknown} from 'unresolved'; - - @Component({ - selector: 'tmp', - template: () => {}, - providers: [triggers()] - }) - export class BadComponent { - - } - `; - init(data, [], () => {}, {verboseInvalidExpression: true}); - - const badComponent = reflector.getStaticSymbol(file, 'BadComponent'); - const annotations = reflector.annotations(badComponent); - const annotation = annotations[0]; - expect(annotation.providers).toEqual([]); - }); - describe('inheritance', () => { class ClassDecorator { constructor(public value: any) {} diff --git a/packages/compiler/test/aot/static_symbol_resolver_spec.ts b/packages/compiler/test/aot/static_symbol_resolver_spec.ts index 944d6c503c..9adfc0ebdf 100644 --- a/packages/compiler/test/aot/static_symbol_resolver_spec.ts +++ b/packages/compiler/test/aot/static_symbol_resolver_spec.ts @@ -436,9 +436,6 @@ export class MockStaticSymbolResolverHost implements StaticSymbolResolverHost { } return baseName + '.d.ts'; } - if (modulePath == 'unresolved') { - return undefined; - } return '/tmp/' + modulePath + '.d.ts'; }