Skip to content

Batched expressions all fail when any subexpression fails #2551

Open
@biggs0125

Description

@biggs0125

Consider the following code:

class A {
  int get foo => 3;
  int get bar => throw 'bad';
}

void main() {
  final a = A();
  debugger(); // <-- stop here
}

Given the shown breakpoint, in DevTools we would expect to be able to expand a and evaluate the subfields of A. We should see something like foo: 3, bar: "Error: bad".

However, dwds tries to batch these expressions and sends a single request to Chrome like [x.foo, x.bar]. This array expression fails to evaluate because one of the subexpressions throws. When the full expression fails, the batch evaluator ends up resolving to an error for every expression in the batch.

DevTools surfaces this as:

Failed to evaluate expression 'x.foo': InternalError: No batch result object ID. 
Failed to evaluate expression 'x.bar': InternalError: No batch result object ID.

Instead we should be showing the correct value for foo and the error thrown for bar.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions