Unverified Commit c04f0a2b authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

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

parent 0d79013a
...@@ -115,11 +115,8 @@ class _LayoutBuilderElement<ConstraintType extends Constraints> extends RenderOb ...@@ -115,11 +115,8 @@ class _LayoutBuilderElement<ConstraintType extends Constraints> extends RenderOb
} }
void _layout(ConstraintType constraints) { void _layout(ConstraintType constraints) {
// TODO(goderbauer): When https://github.com/dart-lang/sdk/issues/45710 is @pragma('vm:notify-debugger-on-exception')
// fixed: refactor the anonymous closure below into a named one, apply the void layoutCallback() {
// @pragma('vm:notify-debugger-on-exception') to it and enable the
// corresponding test in break_on_framework_exceptions_test.dart.
owner!.buildScope(this, () {
Widget built; Widget built;
try { try {
built = widget.builder(this, constraints); built = widget.builder(this, constraints);
...@@ -152,7 +149,9 @@ class _LayoutBuilderElement<ConstraintType extends Constraints> extends RenderOb ...@@ -152,7 +149,9 @@ class _LayoutBuilderElement<ConstraintType extends Constraints> extends RenderOb
); );
_child = updateChild(null, built, slot); _child = updateChild(null, built, slot);
} }
}); }
owner!.buildScope(this, layoutCallback);
} }
@override @override
......
...@@ -388,7 +388,7 @@ void main() { ...@@ -388,7 +388,7 @@ void main() {
final int breakLine = (await flutter.getSourceLocation()).line; final int breakLine = (await flutter.getSourceLocation()).line;
expect(breakLine, project.lineContaining(project.test, "throw 'LayoutBuilder.builder';")); 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 { testWithoutContext('breaks when _CallbackHookProvider callback throws', () async {
final TestProject project = TestProject( final TestProject project = TestProject(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment