@@ -642,13 +642,13 @@ int32_t ToUnicode(MaybeStackBuffer<char>* buf, |
642 | 642 | int32_t ToASCII(MaybeStackBuffer<char>* buf, |
643 | 643 | const char* input, |
644 | 644 | size_t length, |
645 | | - enum idna_mode mode) { |
| 645 | + idna_mode mode) { |
646 | 646 | UErrorCode status = U_ZERO_ERROR; |
647 | 647 | uint32_t options = // CheckHyphens = false; handled later |
648 | 648 | UIDNA_CHECK_BIDI | // CheckBidi = true |
649 | 649 | UIDNA_CHECK_CONTEXTJ | // CheckJoiners = true |
650 | 650 | UIDNA_NONTRANSITIONAL_TO_ASCII; // Nontransitional_Processing |
651 | | - if (mode == IDNA_STRICT) { |
| 651 | + if (mode == idna_mode::kStrict) { |
652 | 652 | options |= UIDNA_USE_STD3_RULES; // UseSTD3ASCIIRules = beStrict |
653 | 653 | // VerifyDnsLength = beStrict; |
654 | 654 | // handled later |
@@ -696,14 +696,14 @@ int32_t ToASCII(MaybeStackBuffer<char>* buf, |
696 | 696 | info.errors &= ~UIDNA_ERROR_LEADING_HYPHEN; |
697 | 697 | info.errors &= ~UIDNA_ERROR_TRAILING_HYPHEN; |
698 | 698 |
|
699 | | - if (mode != IDNA_STRICT) { |
| 699 | + if (mode != idna_mode::kStrict) { |
700 | 700 | // VerifyDnsLength = beStrict |
701 | 701 | info.errors &= ~UIDNA_ERROR_EMPTY_LABEL; |
702 | 702 | info.errors &= ~UIDNA_ERROR_LABEL_TOO_LONG; |
703 | 703 | info.errors &= ~UIDNA_ERROR_DOMAIN_NAME_TOO_LONG; |
704 | 704 | } |
705 | 705 |
|
706 | | - if (U_FAILURE(status) || (mode != IDNA_LENIENT && info.errors != 0)) { |
| 706 | + if (U_FAILURE(status) || (mode != idna_mode::kLenient && info.errors != 0)) { |
707 | 707 | len = -1; |
708 | 708 | buf->SetLength(0); |
709 | 709 | } else { |
@@ -741,7 +741,7 @@ static void ToASCII(const FunctionCallbackInfo<Value>& args) { |
741 | 741 | Utf8Value val(env->isolate(), args[0]); |
742 | 742 | // optional arg |
743 | 743 | bool lenient = args[1]->BooleanValue(env->isolate()); |
744 | | - enum idna_mode mode = lenient ? IDNA_LENIENT : IDNA_DEFAULT; |
| 744 | + idna_mode mode = lenient ? idna_mode::kLenient : idna_mode::kDefault; |
745 | 745 |
|
746 | 746 | MaybeStackBuffer<char> buf; |
747 | 747 | int32_t len = ToASCII(&buf, *val, val.length(), mode); |
|