You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge the two copies of a function that convert a JS promise to a Dart
Future. Reuse this function for the specialized case of converting to a
`Future<Map>`.
- Rename `convertNativePromiseToDartFuture` to the shorter and more
widely used `promiseToFuture`. Update one existing use of the old
name.
- Make the method generic to match the previous implementation of
`promiseToFuture`.
- Update the code generator template to not emit the second copy of the
method.
- Use the existing `promiseToFuture` with a `.then` call to implement
`promiseToFutureAsMap`. Update the doc comment to follow best
practices.
- Duplicate all above changes to nnbd SDK copy.
Change-Id: Ib3bbf17477efec3666b24fd4019ca8ce68f0b5b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119174
Commit-Queue: Nate Bosch <[email protected]>
Reviewed-by: Stephen Adams <[email protected]>
Reviewed-by: Sigmund Cherem <[email protected]>
0 commit comments