angular-cn/packages/compiler-cli/test/compliance
crisbeto fcdada53f1 fix(ivy): constant object literals shared across element and component instances (#33705)
Currently if a consumer does something like the following, the object literal will be shared across the two elements and any instances of the component template. The same applies to array literals:

```
<div [someDirective]="{}"></div>
<div [someDirective]="{}"></div>
```

These changes make it so that we generate a pure function even if an object is constant so that each instance gets its own object.

Note that the original design for this fix included moving the pure function factories into the `consts` array. In the process of doing so I realized that pure function are also used inside of directive host bindings which means that we don't have access to the `consts`.

These changes also:
* Fix an issue that meant that the `pureFunction0` instruction could only be run during creation mode.
* Make the `getConstant` utility slightly more convenient to use. This isn't strictly required for these changes to work, but I had made it as a part of a larger refactor that I ended up reverting.

PR Close #33705
2019-11-13 13:36:41 -08:00
..
BUILD.bazel refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00
README.md build: use bazel version from node modules (#26691) 2018-10-30 16:19:13 -04:00
mock_compile.ts refactor(ivy): update the compiler to emit `$localize` tags (#31609) 2019-08-30 12:53:26 -07:00
mock_compiler_spec.ts test(compiler-cli): compliance tests not always reporting test failure (#30597) 2019-05-22 16:22:52 -07:00
r3_compiler_compliance_spec.ts fix(ivy): constant object literals shared across element and component instances (#33705) 2019-11-13 13:36:41 -08:00
r3_view_compiler_binding_spec.ts perf(ivy): chain listener instructions (#33720) 2019-11-12 09:59:13 -08:00
r3_view_compiler_di_spec.ts refactor(core): rename ngInjectableDef to ɵprov (#33151) 2019-10-16 16:36:19 -04:00
r3_view_compiler_directives_spec.ts refactor(core): rename ngFactoryDef to ɵfac (#33116) 2019-10-14 20:27:25 +00:00
r3_view_compiler_i18n_spec.ts fix(ivy): more descriptive errors for nested i18n sections (#33583) 2019-11-05 17:20:47 +00:00
r3_view_compiler_input_outputs_spec.ts refactor(ivy): remove ngBaseDef (#33264) 2019-10-25 13:11:34 -07:00
r3_view_compiler_listener_spec.ts perf(ivy): chain listener instructions (#33720) 2019-11-12 09:59:13 -08:00
r3_view_compiler_providers_spec.ts refactor(core): rename ngFactoryDef to ɵfac (#33116) 2019-10-14 20:27:25 +00:00
r3_view_compiler_spec.ts perf(ivy): chain multiple property instructions (#31078) 2019-06-19 15:42:37 -07:00
r3_view_compiler_styling_spec.ts fix(ivy): constant object literals shared across element and component instances (#33705) 2019-11-13 13:36:41 -08:00
r3_view_compiler_template_spec.ts perf(ivy): move local references into consts array (#33129) 2019-11-04 16:30:53 +00:00

README.md

Tests in this directory should be run with:

yarn bazel test --define=compile=aot  packages/compiler-cli/test/compliance:compliance