Enable vm:notify-debugger-on-exception for LayoutBuilder (#82835)

This commit is contained in:
Michael Goderbauer 2021-05-21 18:39:13 -07:00 committed by GitHub
parent 0d79013a81
commit c04f0a2b69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View file

@ -115,11 +115,8 @@ class _LayoutBuilderElement<ConstraintType extends Constraints> extends RenderOb
}
void _layout(ConstraintType constraints) {
// TODO(goderbauer): When https://github.com/dart-lang/sdk/issues/45710 is
// fixed: refactor the anonymous closure below into a named one, apply the
// @pragma('vm:notify-debugger-on-exception') to it and enable the
// corresponding test in break_on_framework_exceptions_test.dart.
owner!.buildScope(this, () {
@pragma('vm:notify-debugger-on-exception')
void layoutCallback() {
Widget built;
try {
built = widget.builder(this, constraints);
@ -152,7 +149,9 @@ class _LayoutBuilderElement<ConstraintType extends Constraints> extends RenderOb
);
_child = updateChild(null, built, slot);
}
});
}
owner!.buildScope(this, layoutCallback);
}
@override

View file

@ -388,7 +388,7 @@ void main() {
final int breakLine = (await flutter.getSourceLocation()).line;
expect(breakLine, project.lineContaining(project.test, "throw 'LayoutBuilder.builder';"));
}, skip: 'TODO(goderbauer): Once https://github.com/dart-lang/sdk/issues/45710 is fixed, fix TODO in _LayoutBuilderElement._layout and enable this test');
});
testWithoutContext('breaks when _CallbackHookProvider callback throws', () async {
final TestProject project = TestProject(