зеркало из https://github.com/mozilla/gecko-dev.git
[INFER] Fix colorized spew bug with ANSI reset codes. r=mrbkap
This commit is contained in:
Родитель
1a9172da14
Коммит
22c5665ab5
|
@ -168,10 +168,18 @@ static bool InferSpewColorable()
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
||||||
|
const char *
|
||||||
|
types::InferSpewColorReset()
|
||||||
|
{
|
||||||
|
if (!InferSpewColorable())
|
||||||
|
return "";
|
||||||
|
return "\x1b[0m";
|
||||||
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
types::InferSpewColor(TypeConstraint *constraint)
|
types::InferSpewColor(TypeConstraint *constraint)
|
||||||
{
|
{
|
||||||
/* Type constraints are printed out using background colors. */
|
/* Type constraints are printed out using foreground colors. */
|
||||||
static const char *colors[] = { "\x1b[31m", "\x1b[32m", "\x1b[33m",
|
static const char *colors[] = { "\x1b[31m", "\x1b[32m", "\x1b[33m",
|
||||||
"\x1b[34m", "\x1b[35m", "\x1b[36m",
|
"\x1b[34m", "\x1b[35m", "\x1b[36m",
|
||||||
"\x1b[37m" };
|
"\x1b[37m" };
|
||||||
|
|
|
@ -1038,7 +1038,7 @@ enum SpewChannel {
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
||||||
inline const char * InferSpewColorReset() { return "\x1b[0m"; }
|
const char * InferSpewColorReset();
|
||||||
const char * InferSpewColor(TypeConstraint *constraint);
|
const char * InferSpewColor(TypeConstraint *constraint);
|
||||||
const char * InferSpewColor(TypeSet *types);
|
const char * InferSpewColor(TypeSet *types);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче