queueCallOf function

MethodInvocation? queueCallOf(
  1. Expression waited
)

The call waited waits for: the target of .value or .done when it is a call, or waited itself when it calls close or cancelAll.

Implementation

MethodInvocation? queueCallOf(Expression waited) {
  if (waited is PropertyAccess &&
      const {'value', 'done'}.contains(waited.propertyName.name)) {
    final target = waited.realTarget.unParenthesized;
    return target is MethodInvocation ? target : null;
  }
  if (waited is MethodInvocation &&
      const {'close', 'cancelAll'}.contains(waited.methodName.name)) {
    return waited;
  }
  return null;
}