Please sign in to comment.
fix(ngcc): do not add trailing commas in UMD imports (#34545)
Previously, if `UmdRenderingFormatter#addImports()` was called with an empty list of imports to add (i.e. no new imports were needed), it would add trailing commas in several locations (arrays, function arguments, function parameters), thus making the code imcompatible with legacy browsers such as IE11. This commit fixes it by ensuring that no trailing commas are added if `addImports()` is called with an empty list of imports. This is a follow-up to #34353. Fixes #34525 PR Close #34545
- Loading branch information
Showing with 74 additions and 1 deletion.
- +15 −0 integration/ngcc/test.sh
- +5 −0 packages/compiler-cli/ngcc/src/rendering/commonjs_rendering_formatter.ts
- +5 −1 packages/compiler-cli/ngcc/src/rendering/esm_rendering_formatter.ts
- +4 −0 packages/compiler-cli/ngcc/src/rendering/umd_rendering_formatter.ts
- +11 −0 packages/compiler-cli/ngcc/test/rendering/commonjs_rendering_formatter_spec.ts
- +11 −0 packages/compiler-cli/ngcc/test/rendering/esm5_rendering_formatter_spec.ts
- +11 −0 packages/compiler-cli/ngcc/test/rendering/esm_rendering_formatter_spec.ts
- +12 −0 packages/compiler-cli/ngcc/test/rendering/umd_rendering_formatter_spec.ts