Commit 1985977
Elements. Simplify
The `_writeElementList` helper in the element text test utility included
complex logic to handle element types that lack a standard
`enclosingElement`. This special casing for `LibraryImport`,
`LibraryExport` (which are not elements at all now), and `PrefixElement`
made the function fragile.
This change removes the conditional logic and tightens the function's
signature to only accept `ElementImpl` (so it cannot be
`SubstitutedXyz`) subtypes. As a result, the call site for `prefixes` is
updated to use the more general `_writeList` function, leaving
`_writeElementList` with the single responsibility of verifying the
`enclosingElement` for applicable types.
Change-Id: I436a863a59bb0394556002bd720c363eacea826b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/445620
Reviewed-by: Paul Berry <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>_writeElementList test utility1 parent 02c8fd2 commit 1985977
1 file changed
+4
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
458 | 457 | | |
459 | 458 | | |
460 | 459 | | |
461 | | - | |
| 460 | + | |
462 | 461 | | |
463 | | - | |
| 462 | + | |
464 | 463 | | |
465 | 464 | | |
466 | 465 | | |
| |||
469 | 468 | | |
470 | 469 | | |
471 | 470 | | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
| 471 | + | |
485 | 472 | | |
486 | 473 | | |
487 | 474 | | |
| |||
1220 | 1207 | | |
1221 | 1208 | | |
1222 | 1209 | | |
1223 | | - | |
| 1210 | + | |
1224 | 1211 | | |
1225 | 1212 | | |
1226 | 1213 | | |
| |||
0 commit comments