angular/packages/compiler-cli/src/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.ts feat(compiler-cli): lower metadata useValue and data literal fields (#18905) 2017-08-31 09:46:16 -07:00
expression_diagnostics.ts refactor(compiler-cli): use the transformer based compiler by default 2017-08-10 20:30:40 -07:00
expression_type.ts fix(compiler-cli): allow '==' to compare nullable types (#16731) 2017-05-16 16:36:51 -07:00
symbols.ts fix(language-service): ignore hover of symbols not in the TypeScript program (#17969) 2017-07-07 08:47:28 -07:00
typescript_symbols.ts refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00