[vm] Check for common case (_Future) before uncommon case (is! Future / 3rd party future)
TEST=ci Change-Id: Iac123e20a889d8b3152bd3934c12ed012aebd8d0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231944 Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>
This commit is contained in:
committed by
Commit Bot
parent
c9f223c5bd
commit
68f502cc61
@@ -70,10 +70,10 @@ dynamic Function(Object, StackTrace) _asyncErrorWrapperHelper(
|
||||
Future _awaitHelper(var object, dynamic Function(dynamic) thenCallback,
|
||||
dynamic Function(dynamic, StackTrace) errorCallback, Function awaiter) {
|
||||
late _Future future;
|
||||
if (object is! Future) {
|
||||
future = new _Future().._setValue(object);
|
||||
} else if (object is _Future) {
|
||||
if (object is _Future) {
|
||||
future = object;
|
||||
} else if (object is! Future) {
|
||||
future = new _Future().._setValue(object);
|
||||
} else {
|
||||
return object.then(thenCallback, onError: errorCallback);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user