This repository was archived by the owner on May 12, 2025. It is now read-only.
Commit 38772fa
Added BOM detection and BOM marker removal (#189)
If a source code uses encoding with BOM marker, this marker becomes a part of a prefix in a JS.CompilationUnit.
During the equality check on the Java side (org.openrewrite.Parser.requirePrintEqualsInput) between the source code and the code generated based on the LST, Java trims the BOM marker.
So this causes an idempotency error.
Therefore, we also detect and trim the BOM marker on a JS/TS parser side from JS.CompilationUnit prefix.
Co-authored-by: Andrii Rodionov <[email protected]>1 parent 2d8ec7c commit 38772fa
1 file changed
+33
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
213 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
214 | 244 | | |
215 | 245 | | |
216 | | - | |
| 246 | + | |
217 | 247 | | |
218 | 248 | | |
219 | 249 | | |
220 | | - | |
221 | | - | |
| 250 | + | |
| 251 | + | |
222 | 252 | | |
223 | 253 | | |
224 | 254 | | |
| |||
0 commit comments