Commit 3d8ca6a
authored
fix(jspromise): convert panics to EngineError::Panic using js_expect (boa-dev#4875)
Part of boa-dev#3241
Converts all 23 panics in jspromise.rs to EngineError::Panic using
js_expect introduced in boa-dev#4828.
Patterns converted:
- `.js_expect()` on internal promise operations that cannot fail
- `.js_expect().map_err(Into::into)` for methods returning
`JsResult<JsPromise>`
Signature changes:
- `resolve()`, `reject()`, `from_result()` → `JsResult<Self>`
- `then()`, `catch()`, `finally()` → `JsResult<JsPromise>`
- `all()`, `all_settled()`, `any()`, `race()` → `JsResult<JsPromise>`
- `into_js_future()` → `JsResult<JsFuture>`
Files modified: 61 parent faaf64d commit 3d8ca6a
6 files changed
Lines changed: 132 additions & 97 deletions
File tree
- core/engine/src
- builtins/array
- module
- object/builtins
- examples/src/bin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
452 | | - | |
| 452 | + | |
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
613 | | - | |
| 613 | + | |
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
| 661 | + | |
661 | 662 | | |
662 | 663 | | |
663 | 664 | | |
| |||
669 | 670 | | |
670 | 671 | | |
671 | 672 | | |
| 673 | + | |
672 | 674 | | |
673 | 675 | | |
674 | 676 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
261 | 260 | | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| |||
0 commit comments