angular/packages/compiler-cli/test/ngtsc
Alex Rickabaugh 3938563565 fix(ivy): don't reuse a ts.Program more than once in ngtsc (#30090)
ngtsc previously could attempt to reuse the main ts.Program twice. This
occurred when template type-checking was enabled and then an incremental
build was performed. This breaks a TypeScript invariant - ts.Programs can
only be reused once.

The creation of the template type-checking program reuses the main program,
rendering it moot. Then, on the next incremental build the main program
would be subject to reuse again, which would crash inside TypeScript.

This commit fixes the issue by reusing the template type-checking program
from the previous run on the next incremental build. Since under normal
circumstances the files in the type-checking program aren't changed, this
should be just as fast.

Testing strategy: a test is added in the incremental_spec which validates
that program reuse with type-checking turned on does not crash the compiler.

Fixes #30079

PR Close #30090
2019-04-24 11:41:21 -07:00
..
fake_core feat(ivy): support for template type-checking pipe bindings (#29698) 2019-04-19 11:15:25 -07:00
BUILD.bazel build(bazel): back out of @bazel/jasmine 0.27.7 with shard count (#29444) 2019-03-21 09:59:13 -07:00
env.ts feat(ivy): introduce a flag to control template type-checking for Ivy (#29698) 2019-04-19 11:15:25 -07:00
incremental_spec.ts fix(ivy): don't reuse a ts.Program more than once in ngtsc (#30090) 2019-04-24 11:41:21 -07:00
ngtsc_spec.ts fix(ivy): support module.id as @NgModule's "id" field value (#30040) 2019-04-23 14:50:58 -07:00
scope_spec.ts refactor(ivy): use ɵɵ instead of Δ for now (#29850) 2019-04-11 16:27:56 -07:00
sourcemap_utils.ts feat(ivy): add source mappings to compiled Angular templates (#28055) 2019-02-12 20:58:28 -08:00
template_mapping_spec.ts feat(ivy): generate ɵɵpropertyInterpolateX instructions (#30008) 2019-04-22 17:10:36 -07:00
template_typecheck_spec.ts feat(ivy): support for template type-checking pipe bindings (#29698) 2019-04-19 11:15:25 -07:00