Commit 3220b3c
authored
Add JSError.stack, add Error conformance (#48)
While the `stack` property is non-standard, it's [supported in all popular browser engines](https://caniuse.com/mdn-javascript_builtins_error_stack) and Node.js.
Unfortunately, because `stack` value will be different on every machine that executes it, I'm not sure how to write a good test for it, so it currently has only a single test.
Also, `JSError` now conforms to `Error`. The main reasoning is that the `Publisher` protocol in Combine requires `Error` conformance on its `Failure` type. I think in the future it would make sense to make `JSPromise` compatible with Combine, so it would be great if one could propagate errors produced by `JSPromise` to other publishers/subscribers.1 parent 36f6bdb commit 3220b3c
File tree
2 files changed
+23
-6
lines changed- IntegrationTests/TestSuites/Sources/PrimaryTests
- Sources/JavaScriptKit/BasicObjects
2 files changed
+23
-6
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
| 444 | + | |
444 | 445 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
3 | 10 | | |
4 | 11 | | |
| 12 | + | |
5 | 13 | | |
6 | | - | |
| 14 | + | |
7 | 15 | | |
8 | 16 | | |
| 17 | + | |
9 | 18 | | |
10 | | - | |
| 19 | + | |
11 | 20 | | |
12 | 21 | | |
| 22 | + | |
13 | 23 | | |
14 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
15 | 30 | | |
16 | 31 | | |
17 | 32 | | |
18 | 33 | | |
19 | | - | |
| 34 | + | |
| 35 | + | |
20 | 36 | | |
0 commit comments