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

Commit 59d5445

Browse files
[Engine] allow --enable-asserts flag to be passed to dart vm in profile mode. (#52029)
Allows flutter/flutter#145729
1 parent 5b95daf commit 59d5445

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

shell/common/switches.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ static const std::string kAllowedDartFlags[] = {
6565
"--null_assertions",
6666
"--strict_null_safety_checks",
6767
"--max_subtype_cache_entries",
68+
"--enable-asserts",
6869
};
6970
// clang-format on
7071

shell/common/switches_unittests.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,16 @@ TEST(SwitchesTest, NoEnableImpeller) {
123123
}
124124
}
125125

126+
#if !FLUTTER_RELEASE
127+
TEST(SwitchesTest, EnableAsserts) {
128+
fml::CommandLine command_line = fml::CommandLineFromInitializerList(
129+
{"command", "--dart-flags=--enable-asserts"});
130+
Settings settings = SettingsFromCommandLine(command_line);
131+
ASSERT_EQ(settings.dart_flags.size(), 1ul);
132+
EXPECT_EQ(settings.dart_flags[0], "--enable-asserts");
133+
}
134+
#endif
135+
126136
} // namespace testing
127137
} // namespace flutter
128138

0 commit comments

Comments
 (0)