mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 11:03:19 +00:00
6f677df11a
Also reverts https://dart-review.googlesource.com/c/sdk/+/354840, which attempted the same thing. The vmOptions are not parsed correctly on the bots. Fixes: https://github.com/dart-lang/sdk/issues/550599 Change-Id: I05c7184ffb6d303309714a667d209d3621dcc348 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355960 Commit-Queue: Liam Appelbe <liama@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
28 lines
875 B
Dart
28 lines
875 B
Dart
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// Test that throws during destructuring have the correct stack trace.
|
|
// Regression test for https://github.com/dart-lang/sdk/issues/53519
|
|
|
|
import 'package:expect/expect.dart';
|
|
|
|
String destructure(Map<String, dynamic> map) {
|
|
final {'hello': world, 'count': count} = map;
|
|
return 'Hello $world, count: $count';
|
|
}
|
|
|
|
main() {
|
|
try {
|
|
destructure({
|
|
'hello': 'world',
|
|
// No count entry, so the destructuring fails.
|
|
});
|
|
} catch (e, s) {
|
|
print(s);
|
|
// Expect that the stack trace contains an entry for the destructure
|
|
// function at line 11.
|
|
Expect.isTrue(s.toString().contains(RegExp(r'destructure \(.*:11(:3)?\)')));
|
|
}
|
|
}
|