angular-cn/packages/compiler/test
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
..
aot feat(compiler-cli): lower metadata `useValue` and `data` literal fields (#18905) 2017-08-31 09:46:16 -07:00
css_parser fix(compiler): Update types for TypeScript nullability support 2017-04-10 15:26:33 -06:00
expression_parser feat(compiler): adds support for quoted object keys in the parser 2017-07-07 16:17:33 -07:00
i18n refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
ml_parser perf(core): add option to remove blank text nodes from compiled templates 2017-08-14 13:26:16 -07:00
output refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
schema feat(compiler): update the schema by extracting from latest chrome (#17858) 2017-07-06 12:11:34 -07:00
template_parser refactor(compiler): align &ngsp; handling with Angular Dart implementation (#18774) 2017-08-18 17:13:15 -05:00
core_spec.ts refactor(compiler): add missing test to compare core and compiler metadata (#18739) 2017-08-17 18:00:55 -05:00
directive_lifecycle_spec.ts refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
directive_normalizer_spec.ts refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
directive_resolver_mock_spec.ts refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
directive_resolver_spec.ts refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
integration_spec.ts perf(core): add option to remove blank text nodes from compiled templates 2017-08-14 13:26:16 -07:00
metadata_resolver_fixture.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
metadata_resolver_spec.ts refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
ng_module_resolver_mock_spec.ts refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
ng_module_resolver_spec.ts refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
parse_util_spec.ts build: enable TSLint on the packages folder 2017-07-31 15:47:57 -07:00
pipe_resolver_mock_spec.ts refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
pipe_resolver_spec.ts refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
resource_loader_mock_spec.ts fix(compiler): Update types for TypeScript nullability support 2017-04-10 15:26:33 -06:00
runtime_compiler_spec.ts refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
selector_spec.ts fix(compiler): Update types for TypeScript nullability support 2017-04-10 15:26:33 -06:00
shadow_css_spec.ts feat(compiler): add support `::ng-deep` 2017-06-23 14:43:42 -07:00
spies.ts perf: switch angular to use StaticInjector instead of ReflectiveInjector 2017-08-07 15:42:34 -07:00
style_url_resolver_spec.ts fix(compiler): Don't strip CSS source maps 2017-08-15 16:30:09 -07:00
test_bindings.ts refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
url_resolver_spec.ts fix(compiler): Update types for TypeScript nullability support 2017-04-10 15:26:33 -06:00
util_spec.ts refactor(compiler): allow sync AOT compilation (#16832). 2017-05-23 10:41:23 -06:00