Skip to content

Commit eba7774

Browse files
committed
fixup! fix(@angular/build): handle regex literals in source-map comment scanner
1 parent 76e5da4 commit eba7774

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

‎packages/angular/build/src/utils/source-map.ts‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ function consumeIdentifier(
169169
) {
170170
prevIdx--;
171171
}
172-
const regexAllowed =
173-
(prevIdx < 0 || code[prevIdx] !== '.') && REGEX_PRECEDING_KEYWORDS.has(word);
172+
const regexAllowed = (prevIdx < 0 || code[prevIdx] !== '.') && REGEX_PRECEDING_KEYWORDS.has(word);
174173

175174
return { nextIndex: i, regexAllowed };
176175
}
@@ -222,12 +221,8 @@ function removeSourceMappingURLFromString(code: string): string {
222221
// Stack to track template literal state and curly brace depth for nested interpolations.
223222
const stack: { type: 'template'; braceDepth: number }[] = [];
224223
let currentState:
225-
| 'normal'
226-
| 'string_double'
227-
| 'string_single'
228-
| 'template'
229-
| 'comment_block'
230-
| 'comment_line' = 'normal';
224+
'normal' | 'string_double' | 'string_single' | 'template' | 'comment_block' | 'comment_line' =
225+
'normal';
231226
let regexAllowed = true;
232227

233228
while (i < len) {

0 commit comments

Comments
 (0)