Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow 'userInfo' for native promise.reject + add native error stack s…
…upport (facebook#20940) Summary: As mentioned [here](react-native-community/releases#34 (comment)), Android is missing native Promise reject with a `userInfo` `WritableMap` support and also `nativeStack` support (which addresses `TODO(8850038)`). This PR adds Android support for both of these. React Native on iOS ([here](https://github.com/facebook/react-native/blob/master/React/Base/RCTUtils.m#L433)) and Windows ([here](microsoft/react-native-windows#732)) already support this so this is a relatively minor addition to bring Android in line with the other platforms. (JS support is also [here](https://github.com/facebook/react-native/blob/master/Libraries/BatchedBridge/NativeModules.js#L145-L148)) Existing methods remain unchanged other than general cleanup of variable names (`e -> throwable`) and adding code comments/docs. Additionally, the `ShareTestModule` implementation of Promise (SimplePromise) was updated to reflect these changes - other line changes in this file are from formatting in Android Studio - if this is an issue let me know. - Currently inconsistent with other platforms. - Blocking a couple of issues over at [invertase/react-native-firebase](https://github.com/invertase/react-native-firebase) - save for re-writing everything to Promise resolve only - which is no small change and isn't a great solution either. Pull Request resolved: facebook#20940 Differential Revision: D13412527 Pulled By: cpojer fbshipit-source-id: 2ca6c5f3db9ff2c2986b02edda80bc73432f66d3
- Loading branch information