mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Show all matching enum flags in debug flag formatter (#34689)
* Show all matching enum flags in debug formatter
* Revert "Show all matching enum flags in debug formatter"
This reverts commit 073099722a.
* Same thing but simpler
* Lint
This commit is contained in:
@@ -100,11 +100,13 @@ namespace ts {
|
||||
if (isFlags) {
|
||||
let result = "";
|
||||
let remainingFlags = value;
|
||||
for (let i = members.length - 1; i >= 0 && remainingFlags !== 0; i--) {
|
||||
const [enumValue, enumName] = members[i];
|
||||
if (enumValue !== 0 && (remainingFlags & enumValue) === enumValue) {
|
||||
for (const [enumValue, enumName] of members) {
|
||||
if (enumValue > value) {
|
||||
break;
|
||||
}
|
||||
if (enumValue !== 0 && enumValue & value) {
|
||||
result = `${result}${result ? "|" : ""}${enumName}`;
|
||||
remainingFlags &= ~enumValue;
|
||||
result = `${enumName}${result ? "|" : ""}${result}`;
|
||||
}
|
||||
}
|
||||
if (remainingFlags === 0) {
|
||||
|
||||
Reference in New Issue
Block a user