Repository navigation
Commit 5d29668
committed
fix(web): guard parseBrowserLanguages against invalid locale tags
Skip language tags that Intl.Locale rejects (e.g. en-US@posix reported
by Chromium on Linux with LANG unset) instead of throwing during engine
bootstrap. This prevents a permanent blank page before main() runs.
If all tags are invalid, fall back to the default en-US locale,
preserving the existing never-empty contract without relying on assert.
Adds unit coverage via debugOverrideBrowserLanguages for the invalid
tag and default-locale fallback paths.
Fixes #190510
Signed-off-by: Sankalp Thakur <[email protected]>1 parent e26b384 commit 5d29668
2 files changed
Lines changed: 38 additions & 9 deletions
File tree
- engine/src/flutter/lib/web_ui
- lib/src/engine
- test/engine/platform_dispatcher
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
954 | 954 | | |
955 | 955 | | |
956 | 956 | | |
957 | | - | |
958 | | - | |
959 | | - | |
960 | | - | |
961 | | - | |
962 | | - | |
963 | | - | |
964 | | - | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
965 | 969 | | |
966 | 970 | | |
967 | | - | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
968 | 974 | | |
969 | 975 | | |
970 | 976 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
718 | 741 | | |
719 | 742 | | |
720 | 743 | | |
| |||
0 commit comments