Commit c07c8f1
authored
fix(aws_common): Use isA for JS interop type check in catch clause (#6859)
Replace the typed catch clause `on ProgressEvent catch (e)` with an
inline pattern that casts to `JSAny?` and uses `isA<ProgressEvent>()`
for the type check. This avoids the
`invalid_runtime_check_with_js_interop_types` lint introduced in Dart
3.12 beta, which flags catch clauses and `is` checks using JS interop
types as potentially platform-inconsistent.
The `as JSAny?` cast is a zero-cost extension type cast, and `isA` is
the Dart-recommended approach for runtime-checking JS interop types.1 parent 6ccc39f commit c07c8f1
1 file changed
Lines changed: 4 additions & 2 deletions
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
| |||
0 commit comments