angular/packages/compiler/src
Matt Lewis 880a57d4b3 fix(compiler): prevent shimCssText from adding extra blank lines per CSS comment
The comment placeholder restoration in `shimCssText` appended an unconditional
`+ '\n'` to each non-hash comment replacement. Because `_commentRe` does not
consume the newline that follows a comment in the source, that newline already
remains in `cssText`. The extra `'\n'` was therefore inserted on top of the
existing one, shifting every line after each comment down by one. In files with
many comments (e.g. large SCSS preambles) this shifts all subsequent CSS rules
far enough that the CSS sourcemap — generated before `shimCssText` runs —
points to completely wrong source locations in browser DevTools.

The fix is to drop the `+ '\n'`; internal newlines within a multi-line comment
are still preserved via `_newLinesRe`, and the trailing newline that follows the
comment in `cssText` is already present without any extra injection.

(cherry picked from commit 5a712d42d1)
2026-03-20 15:17:35 -07:00
..
expression_parser feat(compiler): Add support for the instanceof binary operator 2026-01-13 08:33:12 -08:00
i18n ci: reformat files 2025-12-16 14:44:19 -08:00
ml_parser fix(compiler): parse named HTML entities containing digits 2026-03-17 12:54:45 -07:00
output feat(compiler): Add support for the instanceof binary operator 2026-01-13 08:33:12 -08:00
render3 fix(compiler): ensure generated code compiles 2026-03-13 12:53:47 -06:00
schema fix(compiler): disallow translations of iframe src 2026-03-12 10:01:31 -07:00
template/pipeline fix(compiler): ensure generated code compiles 2026-03-13 12:53:47 -06:00
template_parser fix(compiler): stop ThisReceiver inheritance from ImplicitReceiver 2026-01-02 08:21:49 +01:00
chars.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
combined_visitor.ts feat(compiler): Exhaustive checks for switch blocks 2026-02-17 10:25:31 -08:00
compiler.ts feat(compiler): Exhaustive checks for switch blocks 2026-02-17 10:25:31 -08:00
compiler_facade_interface.ts refactor(forms): move control logic into FormField directive 2026-01-29 13:17:40 -08:00
config.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
constant_pool.ts feat(core): support spread elements in array literals 2026-01-07 12:37:52 -05:00
core.ts feat(core): add ChangeDetectionStrategy.Eager alias for Default 2026-01-30 14:20:52 -08:00
directive_matching.ts refactor(compiler): add more information to template binder (#60977) 2025-04-24 13:02:39 -07:00
injectable_compiler_2.ts refactor(compiler): avoid duplication between FactoryTarget type (#61472) 2025-05-20 10:00:43 +00:00
jit_compiler_facade.ts refactor(forms): move control logic into FormField directive 2026-01-29 13:17:40 -08:00
parse_util.ts refactor(compiler): ensure compiler passes closure conformance checks (#62500) 2025-07-07 16:14:16 +00:00
resource_loader.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
shadow_css.ts fix(compiler): prevent shimCssText from adding extra blank lines per CSS comment 2026-03-20 15:17:35 -07:00
style_url_resolver.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
util.ts refactor(compiler): remove unused code (#61668) 2025-05-26 12:21:09 +00:00
version.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00