@@ -642,13 +642,13 @@ int32_t ToUnicode(MaybeStackBuffer<char>* buf,
642642int32_t ToASCII (MaybeStackBuffer<char >* buf,
643643 const char * input,
644644 size_t length,
645- enum idna_mode mode) {
645+ idna_mode mode) {
646646 UErrorCode status = U_ZERO_ERROR;
647647 uint32_t options = // CheckHyphens = false; handled later
648648 UIDNA_CHECK_BIDI | // CheckBidi = true
649649 UIDNA_CHECK_CONTEXTJ | // CheckJoiners = true
650650 UIDNA_NONTRANSITIONAL_TO_ASCII; // Nontransitional_Processing
651- if (mode == IDNA_STRICT) {
651+ if (mode == idna_mode:: IDNA_STRICT) {
652652 options |= UIDNA_USE_STD3_RULES; // UseSTD3ASCIIRules = beStrict
653653 // VerifyDnsLength = beStrict;
654654 // handled later
@@ -696,14 +696,15 @@ int32_t ToASCII(MaybeStackBuffer<char>* buf,
696696 info.errors &= ~UIDNA_ERROR_LEADING_HYPHEN;
697697 info.errors &= ~UIDNA_ERROR_TRAILING_HYPHEN;
698698
699- if (mode != IDNA_STRICT) {
699+ if (mode != idna_mode:: IDNA_STRICT) {
700700 // VerifyDnsLength = beStrict
701701 info.errors &= ~UIDNA_ERROR_EMPTY_LABEL;
702702 info.errors &= ~UIDNA_ERROR_LABEL_TOO_LONG;
703703 info.errors &= ~UIDNA_ERROR_DOMAIN_NAME_TOO_LONG;
704704 }
705705
706- if (U_FAILURE (status) || (mode != IDNA_LENIENT && info.errors != 0 )) {
706+ if (U_FAILURE (status) ||
707+ (mode != idna_mode::IDNA_LENIENT && info.errors != 0 )) {
707708 len = -1 ;
708709 buf->SetLength (0 );
709710 } else {
@@ -741,7 +742,7 @@ static void ToASCII(const FunctionCallbackInfo<Value>& args) {
741742 Utf8Value val (env->isolate (), args[0 ]);
742743 // optional arg
743744 bool lenient = args[1 ]->BooleanValue (env->isolate ());
744- enum idna_mode mode = lenient ? IDNA_LENIENT : IDNA_DEFAULT;
745+ idna_mode mode = lenient ? idna_mode:: IDNA_LENIENT : idna_mode:: IDNA_DEFAULT;
745746
746747 MaybeStackBuffer<char > buf;
747748 int32_t len = ToASCII (&buf, *val, val.length (), mode);
0 commit comments