Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

mock/zone.dart Assertion that _asyncErrors.isEmpty makes debugging in checked mode difficult #1739

Open
@kendalharland

Description

@kendalharland

From: angular.dart/lib/mock/zone.dart : microLeap, line 50

microLeap() {
  while (_asyncQueue.isNotEmpty) {
    // copy the queue as it may change.
    var toRun = new List.from(_asyncQueue);
    _asyncQueue.clear();
    // TODO: Support the case where multiple exceptions are thrown.
    // e.g. with a throwNextException() method.
    assert(_asyncErrors.isEmpty);
    toRun.forEach((fn) => fn());
    if (_asyncErrors.isNotEmpty) {
      var e = _asyncErrors.removeAt(0);
      throw ['Async error', e[0], e[1]];
    }
  }
}

When run in checked mode, assert(_asyncErrors.isEmpty) halts execution and the errors from _asyncErrors are never re-thrown which makes debugging difficult. Is this assertion necessary?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions