Skip to content

Commit 9231c61

Browse files
srujzsCommit Queue
authored and
Commit Queue
committed
[dart:html] Remove duplicate switch case
Fixes #51754 META and WIN_KEY_LEFT have the same value. The switch case for the second value is never triggered, so we should remove it. CoreLibraryReviewExempt: No functional change, just silencing warnings. Change-Id: I51afe53a3d41e2c2fa820c2bb16e1bdea4583fac Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290702 Commit-Queue: Srujan Gaddam <[email protected]> Reviewed-by: Johnni Winther <[email protected]>
1 parent 884f42a commit 9231c61

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

sdk/lib/html/dart2js/html_dart2js.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38067,7 +38067,7 @@ abstract class KeyCode {
3806738067
static const int Y = 89;
3806838068
static const int Z = 90;
3806938069
static const int META = 91;
38070-
static const int WIN_KEY_LEFT = 91;
38070+
static const int WIN_KEY_LEFT = 91; // Note that it's the same value as META.
3807138071
static const int WIN_KEY_RIGHT = 92;
3807238072
static const int CONTEXT_MENU = 93;
3807338073
static const int NUM_ZERO = 96;
@@ -38292,7 +38292,8 @@ abstract class KeyCode {
3829238292
return _KeyName.UP;
3829338293
case KeyCode.WIN_IME:
3829438294
case KeyCode.WIN_KEY:
38295-
case KeyCode.WIN_KEY_LEFT:
38295+
// Covered by `KeyCode.META` above.
38296+
// case KeyCode.WIN_KEY_LEFT:
3829638297
case KeyCode.WIN_KEY_RIGHT:
3829738298
return _KeyName.WIN;
3829838299
default:

tools/dom/src/KeyCode.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ abstract class KeyCode {
9595
static const int Y = 89;
9696
static const int Z = 90;
9797
static const int META = 91;
98-
static const int WIN_KEY_LEFT = 91;
98+
static const int WIN_KEY_LEFT = 91; // Note that it's the same value as META.
9999
static const int WIN_KEY_RIGHT = 92;
100100
static const int CONTEXT_MENU = 93;
101101
static const int NUM_ZERO = 96;
@@ -320,7 +320,8 @@ abstract class KeyCode {
320320
return _KeyName.UP;
321321
case KeyCode.WIN_IME:
322322
case KeyCode.WIN_KEY:
323-
case KeyCode.WIN_KEY_LEFT:
323+
// Covered by `KeyCode.META` above.
324+
// case KeyCode.WIN_KEY_LEFT:
324325
case KeyCode.WIN_KEY_RIGHT:
325326
return _KeyName.WIN;
326327
default:

0 commit comments

Comments
 (0)