Please sign in to comment.
fix(ivy): throw a better error when DI can't inject a ctor param (#33739
) (#34340) Occasionally a factory function needs to be generated for an "invalid" constructor (one with parameters types which aren't injectable). Typically this happens in JIT mode where understanding of parameters cannot be done in the same "up-front" way that the AOT compiler can. This commit changes the JIT compiler to generate a new `invalidFactoryDep` call for each invalid parameter. This instruction will error at runtime if called, indicating both the index of the invalid parameter as well as (via the stack trace) the factory function which was generated for the type being constructed. Fixes #33637 PR Close #33739 PR Close #34340
- Loading branch information
Showing with 97 additions and 10 deletions.
- +1 −0 packages/compiler/src/compiler_facade_interface.ts
- +10 −2 packages/compiler/src/render3/r3_factory.ts
- +1 −0 packages/compiler/src/render3/r3_identifiers.ts
- +1 −0 packages/core/src/compiler/compiler_facade_interface.ts
- +1 −1 packages/core/src/di/index.ts
- +24 −0 packages/core/src/di/injector_compatibility.ts
- +2 −1 packages/core/src/di/jit/environment.ts
- +5 −5 packages/core/src/di/jit/util.ts
- +2 −1 packages/core/src/render3/jit/environment.ts
- +48 −0 packages/core/test/render3/ivy/jit_spec.ts
- +2 −0 tools/public_api_guard/core/core.d.ts