@@ -616,13 +616,13 @@ int32_t ToUnicode(MaybeStackBuffer<char>* buf,
616
616
int32_t ToASCII (MaybeStackBuffer<char >* buf,
617
617
const char * input,
618
618
size_t length,
619
- enum idna_mode mode) {
619
+ idna_mode mode) {
620
620
UErrorCode status = U_ZERO_ERROR;
621
621
uint32_t options = // CheckHyphens = false; handled later
622
622
UIDNA_CHECK_BIDI | // CheckBidi = true
623
623
UIDNA_CHECK_CONTEXTJ | // CheckJoiners = true
624
624
UIDNA_NONTRANSITIONAL_TO_ASCII; // Nontransitional_Processing
625
- if (mode == IDNA_STRICT ) {
625
+ if (mode == idna_mode:: kStrict ) {
626
626
options |= UIDNA_USE_STD3_RULES; // UseSTD3ASCIIRules = beStrict
627
627
// VerifyDnsLength = beStrict;
628
628
// handled later
@@ -670,14 +670,14 @@ int32_t ToASCII(MaybeStackBuffer<char>* buf,
670
670
info.errors &= ~UIDNA_ERROR_LEADING_HYPHEN;
671
671
info.errors &= ~UIDNA_ERROR_TRAILING_HYPHEN;
672
672
673
- if (mode != IDNA_STRICT ) {
673
+ if (mode != idna_mode:: kStrict ) {
674
674
// VerifyDnsLength = beStrict
675
675
info.errors &= ~UIDNA_ERROR_EMPTY_LABEL;
676
676
info.errors &= ~UIDNA_ERROR_LABEL_TOO_LONG;
677
677
info.errors &= ~UIDNA_ERROR_DOMAIN_NAME_TOO_LONG;
678
678
}
679
679
680
- if (U_FAILURE (status) || (mode != IDNA_LENIENT && info.errors != 0 )) {
680
+ if (U_FAILURE (status) || (mode != idna_mode:: kLenient && info.errors != 0 )) {
681
681
len = -1 ;
682
682
buf->SetLength (0 );
683
683
} else {
@@ -715,7 +715,7 @@ static void ToASCII(const FunctionCallbackInfo<Value>& args) {
715
715
Utf8Value val (env->isolate (), args[0 ]);
716
716
// optional arg
717
717
bool lenient = args[1 ]->BooleanValue (env->isolate ());
718
- enum idna_mode mode = lenient ? IDNA_LENIENT : IDNA_DEFAULT ;
718
+ idna_mode mode = lenient ? idna_mode:: kLenient : idna_mode:: kDefault ;
719
719
720
720
MaybeStackBuffer<char > buf;
721
721
int32_t len = ToASCII (&buf, *val, val.length (), mode);
0 commit comments