angular/packages/compiler-cli/test/diagnostics
Chuck Jazdzewski 0e64261f26 feat(compiler-cli): lower metadata useValue and data literal fields (#18905)
With this commit the compiler will "lower" expressions into exported
variables for values the compiler does not need to know statically
in order to be able to generate a factory. For example:

```
  providers: [{provider: 'token', useValue: calculated()}]
```

produced an error as the expression `calculated()` is not supported
by the compiler because `calculated` is not a
[known function](https://angular.io/guide/metadata#annotationsdecorators)

With this commit this is rewritten, during emit of the .js file, into
something like:

```
export var ɵ0 = calculated();

  ...

  provdiers: [{provider: 'token', useValue: ɵ0}]
```

The compiler then will now generate a reference to the exported `ɵ0`
instead of failing to evaluate `calculated()`.

PR Close #18905
2017-08-31 09:46:16 -07:00
..
check_types_spec.ts feat(compiler-cli): lower metadata useValue and data literal fields (#18905) 2017-08-31 09:46:16 -07:00
expression_diagnostics_spec.ts feat(compiler-cli): new compiler api and command-line using TypeScript transformers 2017-06-23 16:18:44 -07:00
mocks.ts Revert "feat(compiler-cli): add watch mode to ngc (#18818)" 2017-08-30 19:02:03 -07:00
symbol_query_spec.ts build: enable TSLint on the packages folder 2017-07-31 15:47:57 -07:00