Conversation
65d0f41 to
4a34b24
Compare
| functions: 94.44, | ||
| lines: 92.85, | ||
| statements: 92.85, | ||
| branches: 91.89, |
There was a problem hiding this comment.
The reductions here arise from the fallback never triggering since native causes are not used in all tested environments.
Adding test-coverage for the fallback would involve some wider changes to the test suite, I believe.
7daf2d3 to
a44c9ac
Compare
Mrtenz
left a comment
There was a problem hiding this comment.
I think this makes sense. When serialised, the cause is still serialised as data.cause, right?
That's the idea, yes! |
| "exactOptionalPropertyTypes": true, | ||
| "forceConsistentCasingInFileNames": true, | ||
| "lib": ["ES2020"], | ||
| "lib": ["ES2022"], |
There was a problem hiding this comment.
Hmm, I'm not sure we can do this yet due to React Native not supporting ES2020+. There is a thread in chat about this. Search for "ES2020"; it should be the third message down. (I'll DM it to you.)
These changes look good to me otherwise, though.
There was a problem hiding this comment.
@mcmire Since es2022 is not an option, which of the following is preferred?
- Adding
dominstead - Defining/shadowing the
causeproperty explicitly
|
Closing in favor of #140 |
Alternative/follow-up to #140.
This utilizes the runtime
Errorconstructor parameteroptions.causeto propagatedata.cause. The explicit assignment of the property in #140 is preserved as fallback, which should make this change non-breaking.This requires change tsconfig
libfromES2020toES2022to be recognized. Alternatively, if allowing es2022 lib is not desired at this point, thecauseprop could be explicitly added/shadowed like in #140.Related
Based on
metamask-extension preview branch