Backed out 4 changesets (bug 1453456) for build bustages at js/src/jit-test/tests/ctypes/conversion-primitive.js on a CLOSED TREE
authorAndreea Pavel <apavel@mozilla.com>
Sat, 14 Apr 2018 00:52:06 +0300
changeset 413343 f36928548891d9029477f0733c71bb8e093e95f6
parent 413342 50cd4a60a402e9151d461651f565458c79059ec6
child 413344 79dd1948f4bd3c731ab60aa59571bd9db10f09f1
push id62672
push usernerli@mozilla.com
push dateSat, 14 Apr 2018 09:56:18 +0000
treeherderautoland@37b8862d354e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1453456
milestone61.0a1
backs out50cd4a60a402e9151d461651f565458c79059ec6
e0f8f325c2ce3c0e39587f117d63d0872bb9826a
6a84718ddfe1282a2f3e2040eb44081afc5aea16
fde6a66eb3170c0211ba97dcb3b43b4de45e23d8
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 4 changesets (bug 1453456) for build bustages at js/src/jit-test/tests/ctypes/conversion-primitive.js on a CLOSED TREE Backed out changeset 50cd4a60a402 Backed out changeset e0f8f325c2ce (bug 1453456) Backed out changeset 6a84718ddfe1 (bug 1453456) Backed out changeset fde6a66eb317 (bug 1453456)
docshell/base/nsDefaultURIFixup.cpp
dom/base/ResponsiveImageSelector.cpp
dom/html/HTMLInputElement.cpp
dom/html/input/SingleLineTextInputTypes.cpp
dom/mathml/nsMathMLElement.cpp
dom/quota/ActorsParent.cpp
dom/webbrowserpersist/nsWebBrowserPersist.cpp
js/public/UbiNode.h
js/src/builtin/Array.cpp
js/src/builtin/Array.h
js/src/builtin/RegExp.cpp
js/src/builtin/intl/SharedIntlData.cpp
js/src/ctypes/CTypes.cpp
js/src/frontend/TokenStream.cpp
js/src/jsdate.cpp
js/src/jsnum.cpp
js/src/util/Text.h
js/src/vm/JSONParser.cpp
js/src/vm/StringType.cpp
js/src/vm/StringType.h
js/src/vm/TypedArrayObject.cpp
js/src/vm/TypedArrayObject.h
layout/mathml/nsMathMLmpaddedFrame.cpp
mfbt/TextUtils.h
mfbt/tests/TestTextUtils.cpp
netwerk/base/nsStandardURL.cpp
netwerk/base/nsURLHelper.cpp
netwerk/base/nsURLParsers.cpp
netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
xpcom/base/nsCRTGlue.h
xpcom/ds/nsCRT.h
--- a/docshell/base/nsDefaultURIFixup.cpp
+++ b/docshell/base/nsDefaultURIFixup.cpp
@@ -2,32 +2,32 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsIProtocolHandler.h"
+#include "nsCRT.h"
 
 #include "nsIFile.h"
 #include <algorithm>
 
 #ifdef MOZ_TOOLKIT_SEARCH
 #include "nsIBrowserSearchService.h"
 #endif
 
 #include "nsIURIFixup.h"
 #include "nsIURIMutator.h"
 #include "nsDefaultURIFixup.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/ipc/IPCStreamUtils.h"
 #include "mozilla/ipc/URIUtils.h"
-#include "mozilla/TextUtils.h"
 #include "mozilla/Tokenizer.h"
 #include "mozilla/Unused.h"
 #include "nsIObserverService.h"
 #include "nsXULAppAPI.h"
 
 // Used to check if external protocol schemes are usable
 #include "nsCExternalHandlerService.h"
 #include "nsIExternalProtocolService.h"
@@ -741,18 +741,18 @@ nsDefaultURIFixup::PossiblyHostPortUrl(c
   aUrl.EndReading(iterEnd);
   nsACString::const_iterator iter = iterBegin;
 
   while (iter != iterEnd) {
     uint32_t chunkSize = 0;
     // Parse a chunk of the address
     while (iter != iterEnd &&
            (*iter == '-' ||
-            IsAsciiAlpha(*iter) ||
-            IsAsciiDigit(*iter))) {
+            nsCRT::IsAsciiAlpha(*iter) ||
+            nsCRT::IsAsciiDigit(*iter))) {
       ++chunkSize;
       ++iter;
     }
     if (chunkSize == 0 || iter == iterEnd) {
       return false;
     }
     if (*iter == ':') {
       // Go onto checking the for the digits
@@ -770,17 +770,17 @@ nsDefaultURIFixup::PossiblyHostPortUrl(c
   }
   ++iter;
 
   // Count the number of digits after the colon and before the
   // next forward slash (or end of string)
 
   uint32_t digitCount = 0;
   while (iter != iterEnd && digitCount <= 5) {
-    if (IsAsciiDigit(*iter)) {
+    if (nsCRT::IsAsciiDigit(*iter)) {
       digitCount++;
     } else if (*iter == '/') {
       break;
     } else {
       // Whatever it is, it ain't a port!
       return false;
     }
     ++iter;
@@ -849,17 +849,17 @@ nsDefaultURIFixup::KeywordURIFixup(const
   while (iter != iterEnd) {
     if (pos >= 1 && foundRSBrackets == 0) {
       if (!(lastLSBracketLoc == 0 &&
             (*iter == ':' ||
              *iter == '.' ||
              *iter == ']' ||
              (*iter >= 'a' && *iter <= 'f') ||
              (*iter >= 'A' && *iter <= 'F') ||
-             IsAsciiDigit(*iter)))) {
+             nsCRT::IsAsciiDigit(*iter)))) {
         looksLikeIpv6 = false;
       }
     }
 
     // If we're at the end of the string or this is the first slash,
     // check if the thing before the slash looks like ipv4:
     if ((iterEnd - iter == 1 ||
          (lastSlashLoc == uint32_t(kNotFound) && *iter == '/')) &&
@@ -895,19 +895,19 @@ nsDefaultURIFixup::KeywordURIFixup(const
                firstQuoteLoc == uint32_t(kNotFound)) {
       firstQuoteLoc = pos;
     } else if (*iter == '[') {
       lastLSBracketLoc = pos;
     } else if (*iter == ']') {
       foundRSBrackets++;
     } else if (*iter == '/') {
       lastSlashLoc = pos;
-    } else if (IsAsciiAlpha(*iter)) {
+    } else if (nsCRT::IsAsciiAlpha(*iter)) {
       hasAsciiAlpha = true;
-    } else if (IsAsciiDigit(*iter)) {
+    } else if (nsCRT::IsAsciiDigit(*iter)) {
       ++foundDigits;
     }
 
     pos++;
     iter++;
   }
 
   if (lastLSBracketLoc > 0 || foundRSBrackets != 1) {
--- a/dom/base/ResponsiveImageSelector.cpp
+++ b/dom/base/ResponsiveImageSelector.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/ResponsiveImageSelector.h"
 #include "mozilla/ServoStyleSetInlines.h"
-#include "mozilla/TextUtils.h"
 #include "nsIURI.h"
 #include "nsIDocument.h"
 #include "nsContentUtils.h"
 #include "nsPresContext.h"
 
 #include "nsCSSParser.h"
 #include "nsCSSProps.h"
 
@@ -51,47 +50,47 @@ ParseFloat(const nsAString& aString, dou
   if (iter == end) {
     return false;
   }
 
   if (*iter == char16_t('-') && ++iter == end) {
     return false;
   }
 
-  if (IsAsciiDigit(*iter)) {
-    for (; iter != end && IsAsciiDigit(*iter) ; ++iter);
+  if (nsCRT::IsAsciiDigit(*iter)) {
+    for (; iter != end && nsCRT::IsAsciiDigit(*iter) ; ++iter);
   } else if (*iter == char16_t('.')) {
     // Do nothing, jumps to fraction part
   } else {
     return false;
   }
 
   // Fraction
   if (*iter == char16_t('.')) {
     ++iter;
-    if (iter == end || !IsAsciiDigit(*iter)) {
+    if (iter == end || !nsCRT::IsAsciiDigit(*iter)) {
       // U+002E FULL STOP character (.) must be followed by one or more ASCII digits
       return false;
     }
 
-    for (; iter != end && IsAsciiDigit(*iter) ; ++iter);
+    for (; iter != end && nsCRT::IsAsciiDigit(*iter) ; ++iter);
   }
 
   if (iter != end && (*iter == char16_t('e') || *iter == char16_t('E'))) {
     ++iter;
     if (*iter == char16_t('-') || *iter == char16_t('+')) {
       ++iter;
     }
 
-    if (iter == end || !IsAsciiDigit(*iter)) {
+    if (iter == end || !nsCRT::IsAsciiDigit(*iter)) {
       // Should have one or more ASCII digits
       return false;
     }
 
-    for (; iter != end && IsAsciiDigit(*iter) ; ++iter);
+    for (; iter != end && nsCRT::IsAsciiDigit(*iter) ; ++iter);
   }
 
   if (iter != end) {
     return false;
   }
 
   nsresult rv;
   aDouble = PromiseFlatString(aString).ToDouble(&rv);
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -99,17 +99,16 @@
 #include "nsContentUtils.h"
 #include "mozilla/dom/DirectionalityUtils.h"
 #include "nsRadioVisitor.h"
 #include "nsTextEditorState.h"
 
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/MathAlgorithms.h"
-#include "mozilla/TextUtils.h"
 
 #include "nsIIDNService.h"
 
 #include <limits>
 
 #include "nsIColorPicker.h"
 #include "nsIStringEnumerator.h"
 #include "HTMLSplitOnSpacesTokenizer.h"
@@ -5044,17 +5043,17 @@ HTMLInputElement::SanitizeValue(nsAStrin
 
 bool HTMLInputElement::IsValidSimpleColor(const nsAString& aValue) const
 {
   if (aValue.Length() != 7 || aValue.First() != '#') {
     return false;
   }
 
   for (int i = 1; i < 7; ++i) {
-    if (!IsAsciiDigit(aValue[i]) &&
+    if (!nsCRT::IsAsciiDigit(aValue[i]) &&
         !(aValue[i] >= 'a' && aValue[i] <= 'f') &&
         !(aValue[i] >= 'A' && aValue[i] <= 'F')) {
       return false;
     }
   }
   return true;
 }
 
@@ -5352,17 +5351,17 @@ HTMLInputElement::NumberOfDaysInMonth(ui
 /* static */ bool
 HTMLInputElement::DigitSubStringToNumber(const nsAString& aStr,
                                          uint32_t aStart, uint32_t aLen,
                                          uint32_t* aRetVal)
 {
   MOZ_ASSERT(aStr.Length() > (aStart + aLen - 1));
 
   for (uint32_t offset = 0; offset < aLen; ++offset) {
-    if (!IsAsciiDigit(aStr[aStart + offset])) {
+    if (!NS_IsAsciiDigit(aStr[aStart + offset])) {
       return false;
     }
   }
 
   nsresult ec;
   *aRetVal = static_cast<uint32_t>(PromiseFlatString(Substring(aStr, aStart, aLen)).ToInteger(&ec));
 
   return NS_SUCCEEDED(ec);
--- a/dom/html/input/SingleLineTextInputTypes.cpp
+++ b/dom/html/input/SingleLineTextInputTypes.cpp
@@ -3,28 +3,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SingleLineTextInputTypes.h"
 
 #include "mozilla/dom/HTMLInputElement.h"
 #include "mozilla/dom/BindingDeclarations.h"
-#include "mozilla/TextUtils.h"
 #include "HTMLSplitOnSpacesTokenizer.h"
 #include "nsContentUtils.h"
 #include "nsCRTGlue.h"
 #include "nsIIDNService.h"
 #include "nsIIOService.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 
-using mozilla::IsAsciiAlpha;
-using mozilla::IsAsciiDigit;
-
 bool
 SingleLineTextInputTypeBase::IsMutable() const
 {
   return !mInputElement->IsDisabled() &&
          !mInputElement->HasAttr(kNameSpaceID_None, nsGkAtoms::readonly);
 }
 
 bool
@@ -222,17 +218,17 @@ EmailInputType::IsValidEmailAddress(cons
   uint32_t length = value.Length();
   uint32_t i = 0;
 
   // Parsing the username.
   for (; i < atPos; ++i) {
     char16_t c = value[i];
 
     // The username characters have to be in this list to be valid.
-    if (!(IsAsciiAlpha(c) || IsAsciiDigit(c) ||
+    if (!(nsCRT::IsAsciiAlpha(c) || nsCRT::IsAsciiDigit(c) ||
           c == '.' || c == '!' || c == '#' || c == '$' || c == '%' ||
           c == '&' || c == '\''|| c == '*' || c == '+' || c == '-' ||
           c == '/' || c == '=' || c == '?' || c == '^' || c == '_' ||
           c == '`' || c == '{' || c == '|' || c == '}' || c == '~' )) {
       return false;
     }
   }
 
@@ -253,17 +249,17 @@ EmailInputType::IsValidEmailAddress(cons
       if (value[i-1] == '.' || value[i-1] == '-') {
         return false;
       }
     } else if (c == '-'){
       // A dash can't follow a dot.
       if (value[i-1] == '.') {
         return false;
       }
-    } else if (!(IsAsciiAlpha(c) || IsAsciiDigit(c) ||
+    } else if (!(nsCRT::IsAsciiAlpha(c) || nsCRT::IsAsciiDigit(c) ||
                  c == '-')) {
       // The domain characters have to be in this list to be valid.
       return false;
     }
   }
 
   return true;
 }
--- a/dom/mathml/nsMathMLElement.cpp
+++ b/dom/mathml/nsMathMLElement.cpp
@@ -4,19 +4,19 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "nsMathMLElement.h"
 #include "base/compiler_specific.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/FontPropertyTypes.h"
-#include "mozilla/TextUtils.h"
 #include "nsGkAtoms.h"
 #include "nsITableCellLayout.h" // for MAX_COLSPAN / MAX_ROWSPAN
+#include "nsCRT.h"
 #include "nsLayoutStylesheetCache.h"
 #include "nsCSSValue.h"
 #include "nsCSSParser.h"
 #include "nsMappedAttributes.h"
 #include "nsStyleConsts.h"
 #include "nsIDocument.h"
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
@@ -416,17 +416,17 @@ nsMathMLElement::ParseNumericValue(const
     if (gotDot && c == '.') {
       if (!(aFlags & PARSE_SUPPRESS_WARNINGS)) {
         ReportLengthParseError(aString, aDocument);
       }
       return false;  // two dots encountered
     }
     else if (c == '.')
       gotDot = true;
-    else if (!IsAsciiDigit(c)) {
+    else if (!nsCRT::IsAsciiDigit(c)) {
       str.Right(unit, stringLength - i);
       // some authors leave blanks before the unit, but that shouldn't
       // be allowed, so don't CompressWhitespace on 'unit'.
       break;
     }
     number.Append(c);
   }
 
--- a/dom/quota/ActorsParent.cpp
+++ b/dom/quota/ActorsParent.cpp
@@ -38,17 +38,16 @@
 #include "mozilla/dom/quota/PQuotaUsageRequestParent.h"
 #include "mozilla/ipc/BackgroundParent.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/IntegerRange.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/StaticPtr.h"
-#include "mozilla/TextUtils.h"
 #include "mozilla/TypeTraits.h"
 #include "mozilla/Unused.h"
 #include "mozStorageCID.h"
 #include "mozStorageHelper.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsComponentManagerUtils.h"
 #include "nsAboutProtocolUtils.h"
 #include "nsCharSeparatedTokenizer.h"
@@ -8329,17 +8328,17 @@ OriginParser::HandleToken(const nsDepend
     case eExpectingAppIdOrScheme: {
       if (aToken.IsEmpty()) {
         QM_WARNING("Expected an app id or scheme (not an empty string)!");
 
         mError = true;
         return;
       }
 
-      if (IsAsciiDigit(aToken.First())) {
+      if (NS_IsAsciiDigit(aToken.First())) {
         // nsDependentCSubstring doesn't provice ToInteger()
         nsCString token(aToken);
 
         nsresult rv;
         uint32_t appId = token.ToInteger(&rv);
         if (NS_SUCCEEDED(rv)) {
           mAppId = appId;
           mState = eExpectingInMozBrowser;
@@ -8490,17 +8489,17 @@ OriginParser::HandleToken(const nsDepend
 
         mState =
           mTokenizer.hasMoreTokens() ? eExpectingEmptyTokenOrPathnameComponent
                                      : eComplete;
 
         return;
       }
 
-      if (aToken.Length() == 1 && IsAsciiAlpha(aToken.First())) {
+      if (aToken.Length() == 1 && NS_IsAsciiAlpha(aToken.First())) {
         mMaybeDriveLetter = true;
 
         mPathnameComponents.AppendElement(aToken);
 
         mState =
           mTokenizer.hasMoreTokens() ? eExpectingEmptyTokenOrPathnameComponent
                                      : eComplete;
 
--- a/dom/webbrowserpersist/nsWebBrowserPersist.cpp
+++ b/dom/webbrowserpersist/nsWebBrowserPersist.cpp
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ArrayUtils.h"
-#include "mozilla/TextUtils.h"
 
 #include "nspr.h"
 
 #include "nsIFileStreams.h"       // New Necko file streams
 #include <algorithm>
 
 #include "nsAutoPtr.h"
 #include "nsNetCID.h"
@@ -26,16 +25,17 @@
 #include "nsIHttpChannelInternal.h"
 #include "nsIEncodedChannel.h"
 #include "nsIUploadChannel.h"
 #include "nsICacheInfoChannel.h"
 #include "nsIFileChannel.h"
 #include "nsEscape.h"
 #include "nsUnicharUtils.h"
 #include "nsIStringEnumerator.h"
+#include "nsCRT.h"
 #include "nsContentCID.h"
 #include "nsStreamUtils.h"
 
 #include "nsCExternalHandlerService.h"
 
 #include "nsIURL.h"
 #include "nsIFileURL.h"
 #include "nsIURIMutator.h"
@@ -2137,17 +2137,17 @@ nsWebBrowserPersist::MakeFilenameFromURI
         {
             // Unescape the file name (GetFileName escapes it)
             NS_UnescapeURL(nameFromURL);
             uint32_t nameLength = 0;
             const char *p = nameFromURL.get();
             for (;*p && *p != ';' && *p != '?' && *p != '#' && *p != '.'
                  ;p++)
             {
-                if (IsAsciiAlpha(*p) || IsAsciiDigit(*p)
+                if (nsCRT::IsAsciiAlpha(*p) || nsCRT::IsAsciiDigit(*p)
                     || *p == '.' || *p == '-' ||  *p == '_' || (*p == ' '))
                 {
                     fileName.Append(char16_t(*p));
                     if (++nameLength == kDefaultMaxFilenameLength)
                     {
                         // Note:
                         // There is no point going any further since it will be
                         // truncated in CalculateUniqueFilename anyway.
--- a/js/public/UbiNode.h
+++ b/js/public/UbiNode.h
@@ -752,24 +752,24 @@ class Node {
     template<typename T>
     bool is() const {
         return base()->typeName() == canonicalTypeName<T>();
     }
 
     template<typename T>
     T* as() const {
         MOZ_ASSERT(isLive());
-        MOZ_ASSERT(this->is<T>());
+        MOZ_ASSERT(is<T>());
         return static_cast<T*>(base()->ptr);
     }
 
     template<typename T>
     T* asOrNull() const {
         MOZ_ASSERT(isLive());
-        return this->is<T>() ? static_cast<T*>(base()->ptr) : nullptr;
+        return is<T>() ? static_cast<T*>(base()->ptr) : nullptr;
     }
 
     // If this node refers to something that can be represented as a JavaScript
     // value that is safe to expose to JavaScript code, return that value.
     // Otherwise return UndefinedValue(). JSStrings, JS::Symbols, and some (but
     // not all!) JSObjects can be exposed.
     JS::Value exposeToJS() const;
 
--- a/js/src/builtin/Array.cpp
+++ b/js/src/builtin/Array.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "builtin/Array-inl.h"
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/MathAlgorithms.h"
-#include "mozilla/TextUtils.h"
 
 #include <algorithm>
 
 #include "jsapi.h"
 #include "jsfriendapi.h"
 #include "jsnum.h"
 #include "jstypes.h"
 #include "jsutil.h"
@@ -51,17 +50,16 @@
 using namespace js;
 using namespace js::gc;
 
 using mozilla::Abs;
 using mozilla::ArrayLength;
 using mozilla::CeilingLog2;
 using mozilla::CheckedInt;
 using mozilla::DebugOnly;
-using mozilla::IsAsciiDigit;
 
 using JS::AutoCheckCannotGC;
 using JS::IsArrayAnswer;
 using JS::ToUint32;
 
 bool
 JS::IsArray(JSContext* cx, HandleObject obj, IsArrayAnswer* answer)
 {
@@ -214,28 +212,28 @@ GetLengthProperty(JSContext* cx, HandleO
  *
  */
 template <typename CharT>
 static bool
 StringIsArrayIndex(const CharT* s, uint32_t length, uint32_t* indexp)
 {
     const CharT* end = s + length;
 
-    if (length == 0 || length > (sizeof("4294967294") - 1) || !IsAsciiDigit(*s))
+    if (length == 0 || length > (sizeof("4294967294") - 1) || !JS7_ISDEC(*s))
         return false;
 
     uint32_t c = 0, previous = 0;
     uint32_t index = JS7_UNDEC(*s++);
 
     /* Don't allow leading zeros. */
     if (index == 0 && s != end)
         return false;
 
     for (; s < end; s++) {
-        if (!IsAsciiDigit(*s))
+        if (!JS7_ISDEC(*s))
             return false;
 
         previous = index;
         c = JS7_UNDEC(*s);
         index = 10 * index + c;
     }
 
     /* Make sure we didn't overflow. */
--- a/js/src/builtin/Array.h
+++ b/js/src/builtin/Array.h
@@ -4,18 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* JS Array interface. */
 
 #ifndef builtin_Array_h
 #define builtin_Array_h
 
-#include "mozilla/TextUtils.h"
-
 #include "jspubtd.h"
 
 #include "vm/ArrayObject.h"
 #include "vm/JSObject.h"
 
 namespace js {
 /* 2^32-2, inclusive */
 const uint32_t MAX_ARRAY_INDEX = 4294967294u;
@@ -29,17 +27,17 @@ IdIsIndex(jsid id, uint32_t* indexp)
         *indexp = (uint32_t)i;
         return true;
     }
 
     if (MOZ_UNLIKELY(!JSID_IS_STRING(id)))
         return false;
 
     JSAtom* atom = JSID_TO_ATOM(id);
-    if (atom->length() == 0 || !mozilla::IsAsciiDigit(atom->latin1OrTwoByteChar(0)))
+    if (atom->length() == 0 || !JS7_ISDEC(atom->latin1OrTwoByteChar(0)))
         return false;
 
     return js::StringIsArrayIndex(atom, indexp);
 }
 
 // The methods below only create dense boxed arrays.
 
 /* Create a dense array with no capacity allocated, length set to 0. */
--- a/js/src/builtin/RegExp.cpp
+++ b/js/src/builtin/RegExp.cpp
@@ -20,17 +20,16 @@
 
 #include "vm/JSObject-inl.h"
 #include "vm/NativeObject-inl.h"
 #include "vm/UnboxedObject-inl.h"
 
 using namespace js;
 
 using mozilla::CheckedInt;
-using mozilla::IsAsciiDigit;
 
 /*
  * ES 2017 draft rev 6a13789aa9e7c6de4e96b7d3e24d9e6eba6584ad 21.2.5.2.2
  * steps 3, 16-25.
  */
 bool
 js::CreateRegExpMatchResult(JSContext* cx, HandleString input, const MatchPairs& matches,
                             MutableHandleValue rval)
@@ -1217,28 +1216,28 @@ InterpretDollar(JSLinearString* matched,
     MOZ_ASSERT(*currentDollar == '$');
 
     /* If there is only a dollar, bail now. */
     if (currentDollar + 1 >= replacementEnd)
         return false;
 
     /* ES 2016 draft Mar 25, 2016 Table 46. */
     char16_t c = currentDollar[1];
-    if (IsAsciiDigit(c)) {
+    if (JS7_ISDEC(c)) {
         /* $n, $nn */
         unsigned num = JS7_UNDEC(c);
         if (num > captures.length()) {
             // The result is implementation-defined, do not substitute.
             return false;
         }
 
         const CharT* currentChar = currentDollar + 2;
         if (currentChar < replacementEnd) {
             c = *currentChar;
-            if (IsAsciiDigit(c)) {
+            if (JS7_ISDEC(c)) {
                 unsigned tmpNum = 10 * num + JS7_UNDEC(c);
                 // If num > captures.length(), the result is implementation-defined.
                 // Consume next character only if num <= captures.length().
                 if (tmpNum <= captures.length()) {
                     currentChar++;
                     num = tmpNum;
                 }
             }
--- a/js/src/builtin/intl/SharedIntlData.cpp
+++ b/js/src/builtin/intl/SharedIntlData.cpp
@@ -5,38 +5,35 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Runtime-wide Intl data shared across compartments. */
 
 #include "builtin/intl/SharedIntlData.h"
 
 #include "mozilla/Assertions.h"
 #include "mozilla/HashFunctions.h"
-#include "mozilla/TextUtils.h"
 
 #include <stdint.h>
 
 #include "builtin/intl/CommonFunctions.h"
 #include "builtin/intl/ICUStubs.h"
 #include "builtin/intl/ScopedICUObject.h"
 #include "builtin/intl/TimeZoneDataGenerated.h"
 #include "builtin/String.h"
 #include "js/Utility.h"
 #include "vm/JSAtom.h"
 
-using mozilla::IsAsciiLowercaseAlpha;
-
 using js::HashNumber;
 using js::intl::StringsAreEqual;
 
 template<typename Char>
 static constexpr Char
 ToUpperASCII(Char c)
 {
-    return IsAsciiLowercaseAlpha(c)
+    return ('a' <= c && c <= 'z')
            ? (c & ~0x20)
            : c;
 }
 
 static_assert(ToUpperASCII('a') == 'A', "verifying 'a' uppercases correctly");
 static_assert(ToUpperASCII('m') == 'M', "verifying 'm' uppercases correctly");
 static_assert(ToUpperASCII('z') == 'Z', "verifying 'z' uppercases correctly");
 static_assert(ToUpperASCII(u'a') == u'A', "verifying u'a' uppercases correctly");
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -4,17 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ctypes/CTypes.h"
 
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Sprintf.h"
-#include "mozilla/TextUtils.h"
 #include "mozilla/Vector.h"
 
 #include <limits>
 #include <math.h>
 #include <stdint.h>
 #if defined(XP_WIN)
 # include <float.h>
 #endif
@@ -41,20 +40,16 @@
 #include "util/Windows.h"
 #include "vm/JSContext.h"
 #include "vm/JSFunction.h"
 
 #include "vm/JSObject-inl.h"
 
 using namespace std;
 
-using mozilla::AsciiAlphanumericToNumber;
-using mozilla::IsAsciiAlpha;
-using mozilla::IsAsciiAlphanumeric;
-
 using JS::AutoCheckCannotGC;
 
 namespace js {
 namespace ctypes {
 
 template <typename CharT>
 size_t
 GetDeflatedUTF8StringLength(JSContext* maybecx, const CharT* chars,
@@ -2931,23 +2926,27 @@ StringToInteger(JSContext* cx, CharT* cp
     base = 16;
   }
 
   // Scan the string left to right and build the number,
   // checking for valid characters 0 - 9, a - f, A - F and overflow.
   IntegerType i = 0;
   while (cp != end) {
     char16_t c = *cp++;
-    if (!IsAsciiAlphanumeric(c))
-        return false;
-
-    uint8_t digit = AsciiAlphanumericToNumber(c);
+    if (c >= '0' && c <= '9')
+      c -= '0';
+    else if (base == 16 && c >= 'a' && c <= 'f')
+      c = c - 'a' + 10;
+    else if (base == 16 && c >= 'A' && c <= 'F')
+      c = c - 'A' + 10;
+    else
+      return false;
 
     IntegerType ii = i;
-    i = ii * base + sign * digit;
+    i = ii * base + sign * c;
     if (i / base != ii) {
       *overflow = true;
       return false;
     }
   }
 
   *result = i;
   return true;
@@ -4051,17 +4050,19 @@ BuildTypeName(JSContext* cx, JSObject* t
       // Either a basic or struct type. Use the type's name as the base type.
       break;
     }
     break;
   }
 
   // If prepending the base type name directly would splice two
   // identifiers, insert a space.
-  if (IsAsciiAlpha(result[0]) || result[0] == '_')
+  if (('a' <= result[0] && result[0] <= 'z') ||
+      ('A' <= result[0] && result[0] <= 'Z') ||
+      (result[0] == '_'))
     PrependString(result, " ");
 
   // Stick the base type and derived type parts together.
   JSString* baseName = CType::GetName(cx, typeObj);
   PrependString(result, baseName);
   return NewUCString(cx, result);
 }
 
--- a/js/src/frontend/TokenStream.cpp
+++ b/js/src/frontend/TokenStream.cpp
@@ -31,17 +31,16 @@
 #include "util/Unicode.h"
 #include "vm/HelperThreads.h"
 #include "vm/JSAtom.h"
 #include "vm/JSCompartment.h"
 #include "vm/JSContext.h"
 
 using mozilla::ArrayLength;
 using mozilla::IsAsciiAlpha;
-using mozilla::IsAsciiDigit;
 using mozilla::MakeScopeExit;
 using mozilla::PodArrayZero;
 using mozilla::PodCopy;
 
 struct ReservedWordInfo
 {
     const char* chars;         // C string with reserved word text
     js::frontend::TokenKind tokentype;
@@ -1595,39 +1594,39 @@ TokenStreamSpecific<CharT, AnyCharsAcces
     //
     if (c1kind == Dec) {
         tp = newToken(-1);
         numStart = userbuf.addressOfNextRawChar() - 1;
 
       decimal:
         decimalPoint = NoDecimal;
         hasExp = false;
-        while (IsAsciiDigit(c))
+        while (JS7_ISDEC(c))
             c = getCharIgnoreEOL();
 
         if (c == '.') {
             decimalPoint = HasDecimal;
           decimal_dot:
             do {
                 c = getCharIgnoreEOL();
-            } while (IsAsciiDigit(c));
+            } while (JS7_ISDEC(c));
         }
         if (c == 'e' || c == 'E') {
             hasExp = true;
             c = getCharIgnoreEOL();
             if (c == '+' || c == '-')
                 c = getCharIgnoreEOL();
-            if (!IsAsciiDigit(c)) {
+            if (!JS7_ISDEC(c)) {
                 ungetCharIgnoreEOL(c);
                 reportError(JSMSG_MISSING_EXPONENT);
                 goto error;
             }
             do {
                 c = getCharIgnoreEOL();
-            } while (IsAsciiDigit(c));
+            } while (JS7_ISDEC(c));
         }
         ungetCharIgnoreEOL(c);
 
         if (c != EOF) {
             if (unicode::IsIdentifierStart(char16_t(c))) {
                 reportError(JSMSG_IDSTART_AFTER_NUMBER);
                 goto error;
             }
@@ -1718,20 +1717,20 @@ TokenStreamSpecific<CharT, AnyCharsAcces
             if (c < '0' || c > '7') {
                 ungetCharIgnoreEOL(c);
                 reportError(JSMSG_MISSING_OCTAL_DIGITS);
                 goto error;
             }
             numStart = userbuf.addressOfNextRawChar() - 1;  // one past the '0o'
             while ('0' <= c && c <= '7')
                 c = getCharIgnoreEOL();
-        } else if (IsAsciiDigit(c)) {
+        } else if (JS7_ISDEC(c)) {
             radix = 8;
             numStart = userbuf.addressOfNextRawChar() - 1;  // one past the '0'
-            while (IsAsciiDigit(c)) {
+            while (JS7_ISDEC(c)) {
                 // Octal integer literals are not permitted in strict mode code.
                 if (!reportStrictModeError(JSMSG_DEPRECATED_OCTAL))
                     goto error;
 
                 // Outside strict mode, we permit 08 and 09 as decimal numbers,
                 // which makes our behaviour a superset of the ECMA numeric
                 // grammar. We might not always be so permissive, so we warn
                 // about it.
@@ -1781,17 +1780,17 @@ TokenStreamSpecific<CharT, AnyCharsAcces
 
     // This handles everything else.
     //
     MOZ_ASSERT(c1kind == Other);
     tp = newToken(-1);
     switch (c) {
       case '.':
         c = getCharIgnoreEOL();
-        if (IsAsciiDigit(c)) {
+        if (JS7_ISDEC(c)) {
             numStart = userbuf.addressOfNextRawChar() - 2;
             decimalPoint = HasDecimal;
             hasExp = false;
             goto decimal_dot;
         }
         if (c == '.') {
             if (matchChar('.')) {
                 tp->type = TokenKind::TripleDot;
@@ -2262,17 +2261,17 @@ TokenStreamSpecific<CharT, AnyCharsAcces
                 // Octal character specification.
                 if (JS7_ISOCT(c)) {
                     int32_t val = JS7_UNOCT(c);
 
                     if (!peekChar(&c))
                         return false;
 
                     // Strict mode code allows only \0, then a non-digit.
-                    if (val != 0 || IsAsciiDigit(c)) {
+                    if (val != 0 || JS7_ISDEC(c)) {
                         TokenStreamAnyChars& anyChars = anyCharsAccess();
                         if (parsingTemplate) {
                             anyChars.setInvalidTemplateEscape(userbuf.offset() - 2,
                                                               InvalidEscapeType::Octal);
                             continue;
                         }
                         if (!reportStrictModeError(JSMSG_DEPRECATED_OCTAL))
                             return false;
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -16,17 +16,16 @@
  */
 
 #include "jsdate.h"
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/Sprintf.h"
-#include "mozilla/TextUtils.h"
 
 #include <ctype.h>
 #include <math.h>
 #include <string.h>
 
 #include "jsapi.h"
 #include "jsnum.h"
 #include "jstypes.h"
@@ -46,17 +45,16 @@
 #include "vm/Time.h"
 
 #include "vm/JSObject-inl.h"
 
 using namespace js;
 
 using mozilla::Atomic;
 using mozilla::ArrayLength;
-using mozilla::IsAsciiAlpha;
 using mozilla::IsFinite;
 using mozilla::IsNaN;
 using mozilla::NumbersAreIdentical;
 using mozilla::Relaxed;
 
 using JS::AutoCheckCannotGC;
 using JS::ClippedTime;
 using JS::GenericNaN;
@@ -1119,17 +1117,17 @@ ParseDate(const CharT* s, size_t length,
             }
             prevc = 0;
         } else if (c == '/' || c == ':' || c == '+' || c == '-') {
             prevc = c;
         } else {
             size_t st = i - 1;
             while (i < length) {
                 c = s[i];
-                if (!IsAsciiAlpha(c))
+                if (!(('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z')))
                     break;
                 i++;
             }
 
             if (i <= st + 1)
                 return false;
 
             int k;
--- a/js/src/jsnum.cpp
+++ b/js/src/jsnum.cpp
@@ -9,17 +9,16 @@
  */
 
 #include "jsnum.h"
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/RangedPtr.h"
-#include "mozilla/TextUtils.h"
 
 #ifdef HAVE_LOCALECONV
 #include <locale.h>
 #endif
 #include <math.h>
 #include <string.h>
 
 #include "jstypes.h"
@@ -37,18 +36,16 @@
 #include "vm/NativeObject-inl.h"
 #include "vm/NumberObject-inl.h"
 #include "vm/StringType-inl.h"
 
 using namespace js;
 
 using mozilla::Abs;
 using mozilla::ArrayLength;
-using mozilla::AsciiAlphanumericToNumber;
-using mozilla::IsAsciiAlphanumeric;
 using mozilla::Maybe;
 using mozilla::MinNumberValue;
 using mozilla::NegativeInfinity;
 using mozilla::PositiveInfinity;
 using mozilla::RangedPtr;
 
 using JS::AutoCheckCannotGC;
 using JS::GenericNaN;
@@ -82,17 +79,17 @@ ComputeAccurateDecimalInteger(JSContext*
 {
     size_t length = end - start;
     ScopedJSFreePtr<char> cstr(cx->pod_malloc<char>(length + 1));
     if (!cstr)
         return false;
 
     for (size_t i = 0; i < length; i++) {
         char c = char(start[i]);
-        MOZ_ASSERT(IsAsciiAlphanumeric(c));
+        MOZ_ASSERT(('0' <= c && c <= '9') || ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'));
         cstr[i] = c;
     }
     cstr[length] = 0;
 
     if (!EnsureDtoaState(cx))
         return false;
 
     char* estr;
@@ -120,18 +117,23 @@ class BinaryDigitReader
 
     /* Return the next binary digit from the number, or -1 if done. */
     int nextDigit() {
         if (digitMask == 0) {
             if (start == end)
                 return -1;
 
             int c = *start++;
-            MOZ_ASSERT(IsAsciiAlphanumeric(c));
-            digit = AsciiAlphanumericToNumber(c);
+            MOZ_ASSERT(('0' <= c && c <= '9') || ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'));
+            if ('0' <= c && c <= '9')
+                digit = c - '0';
+            else if ('a' <= c && c <= 'z')
+                digit = c - 'a' + 10;
+            else
+                digit = c - 'A' + 10;
             digitMask = base >> 1;
         }
 
         int bit = (digit & digitMask) != 0;
         digitMask >>= 1;
         return bit;
     }
 };
@@ -219,24 +221,28 @@ js::GetPrefixInteger(JSContext* cx, cons
                      const CharT** endp, double* dp)
 {
     MOZ_ASSERT(start <= end);
     MOZ_ASSERT(2 <= base && base <= 36);
 
     const CharT* s = start;
     double d = 0.0;
     for (; s < end; s++) {
+        int digit;
         CharT c = *s;
-        if (!IsAsciiAlphanumeric(c))
+        if ('0' <= c && c <= '9')
+            digit = c - '0';
+        else if ('a' <= c && c <= 'z')
+            digit = c - 'a' + 10;
+        else if ('A' <= c && c <= 'Z')
+            digit = c - 'A' + 10;
+        else
             break;
-
-        uint8_t digit = AsciiAlphanumericToNumber(c);
         if (digit >= base)
             break;
-
         d = d * base + digit;
     }
 
     *endp = s;
     *dp = d;
 
     /* If we haven't reached the limit of integer precision, we're done. */
     if (d < DOUBLE_INTEGRAL_PRECISION_LIMIT)
--- a/js/src/util/Text.h
+++ b/js/src/util/Text.h
@@ -4,17 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef util_Text_h
 #define util_Text_h
 
 #include "mozilla/Assertions.h"
 #include "mozilla/Attributes.h"
-#include "mozilla/TextUtils.h"
 
 #include <ctype.h>
 #include <stddef.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <string>
 
 #include "jsutil.h"
@@ -25,22 +24,23 @@
 #include "vm/Printer.h"
 
 class JSLinearString;
 
 /*
  * Shorthands for ASCII (7-bit) decimal and hex conversion.
  * Manually inline isdigit and isxdigit for performance; MSVC doesn't do this for us.
  */
+#define JS7_ISDEC(c)    ((((unsigned)(c)) - '0') <= 9)
 #define JS7_ISA2F(c)    ((((((unsigned)(c)) - 'a') <= 5) || (((unsigned)(c)) - 'A') <= 5))
 #define JS7_UNDEC(c)    ((c) - '0')
 #define JS7_ISOCT(c)    ((((unsigned)(c)) - '0') <= 7)
 #define JS7_UNOCT(c)    (JS7_UNDEC(c))
-#define JS7_ISHEX(c)    ((c) < 128 && (mozilla::IsAsciiDigit(c) || JS7_ISA2F(c)))
-#define JS7_UNHEX(c)    (unsigned)(mozilla::IsAsciiDigit(c) ? (c) - '0' : 10 + tolower(c) - 'a')
+#define JS7_ISHEX(c)    ((c) < 128 && (JS7_ISDEC(c) || JS7_ISA2F(c)))
+#define JS7_UNHEX(c)    (unsigned)(JS7_ISDEC(c) ? (c) - '0' : 10 + tolower(c) - 'a')
 
 static MOZ_ALWAYS_INLINE size_t
 js_strlen(const char16_t* s)
 {
     return std::char_traits<char16_t>::length(s);
 }
 
 template <typename CharT>
--- a/js/src/vm/JSONParser.cpp
+++ b/js/src/vm/JSONParser.cpp
@@ -4,31 +4,29 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "vm/JSONParser.h"
 
 #include "mozilla/Range.h"
 #include "mozilla/RangedPtr.h"
 #include "mozilla/Sprintf.h"
-#include "mozilla/TextUtils.h"
 
 #include <ctype.h>
 
 #include "jsnum.h"
 
 #include "builtin/Array.h"
 #include "util/StringBuffer.h"
 #include "vm/JSCompartment.h"
 
 #include "vm/NativeObject-inl.h"
 
 using namespace js;
 
-using mozilla::IsAsciiDigit;
 using mozilla::RangedPtr;
 
 JSONParserBase::~JSONParserBase()
 {
     for (size_t i = 0; i < stack.length(); i++) {
         if (stack[i].state == FinishArrayElement)
             js_delete(&stack[i].elements());
         else
@@ -242,17 +240,17 @@ JSONParser<CharT>::readString()
     return token(Error);
 }
 
 template <typename CharT>
 JSONParserBase::Token
 JSONParser<CharT>::readNumber()
 {
     MOZ_ASSERT(current < end);
-    MOZ_ASSERT(IsAsciiDigit(*current) || *current == '-');
+    MOZ_ASSERT(JS7_ISDEC(*current) || *current == '-');
 
     /*
      * JSONNumber:
      *   /^-?(0|[1-9][0-9]+)(\.[0-9]+)?([eE][\+\-]?[0-9]+)?$/
      */
 
     bool negative = *current == '-';
 
@@ -260,23 +258,23 @@ JSONParser<CharT>::readNumber()
     if (negative && ++current == end) {
         error("no number after minus sign");
         return token(Error);
     }
 
     const CharPtr digitStart = current;
 
     /* 0|[1-9][0-9]+ */
-    if (!IsAsciiDigit(*current)) {
+    if (!JS7_ISDEC(*current)) {
         error("unexpected non-digit");
         return token(Error);
     }
     if (*current++ != '0') {
         for (; current < end; current++) {
-            if (!IsAsciiDigit(*current))
+            if (!JS7_ISDEC(*current))
                 break;
         }
     }
 
     /* Fast path: no fractional or exponent part. */
     if (current == end || (*current != '.' && *current != 'e' && *current != 'E')) {
         mozilla::Range<const CharT> chars(digitStart.get(), current - digitStart);
         if (chars.length() < strlen("9007199254740992")) {
@@ -297,44 +295,44 @@ JSONParser<CharT>::readNumber()
     }
 
     /* (\.[0-9]+)? */
     if (current < end && *current == '.') {
         if (++current == end) {
             error("missing digits after decimal point");
             return token(Error);
         }
-        if (!IsAsciiDigit(*current)) {
+        if (!JS7_ISDEC(*current)) {
             error("unterminated fractional number");
             return token(Error);
         }
         while (++current < end) {
-            if (!IsAsciiDigit(*current))
+            if (!JS7_ISDEC(*current))
                 break;
         }
     }
 
     /* ([eE][\+\-]?[0-9]+)? */
     if (current < end && (*current == 'e' || *current == 'E')) {
         if (++current == end) {
             error("missing digits after exponent indicator");
             return token(Error);
         }
         if (*current == '+' || *current == '-') {
             if (++current == end) {
                 error("missing digits after exponent sign");
                 return token(Error);
             }
         }
-        if (!IsAsciiDigit(*current)) {
+        if (!JS7_ISDEC(*current)) {
             error("exponent part is missing a number");
             return token(Error);
         }
         while (++current < end) {
-            if (!IsAsciiDigit(*current))
+            if (!JS7_ISDEC(*current))
                 break;
         }
     }
 
     double d;
     const CharT* finish;
     if (!js_strtod(cx, digitStart.get(), current.get(), &finish, &d))
         return token(OOM);
@@ -475,17 +473,17 @@ AssertPastValue(const RangedPtr<const Ch
                (current[-1] == 'e' &&
                 current[-2] == 's' &&
                 current[-3] == 'l' &&
                 current[-4] == 'a' &&
                 current[-5] == 'f') ||
                current[-1] == '}' ||
                current[-1] == ']' ||
                current[-1] == '"' ||
-               IsAsciiDigit(current[-1]));
+               JS7_ISDEC(current[-1]));
 }
 
 template <typename CharT>
 JSONParserBase::Token
 JSONParser<CharT>::advanceAfterArrayElement()
 {
     AssertPastValue(current);
 
--- a/js/src/vm/StringType.cpp
+++ b/js/src/vm/StringType.cpp
@@ -6,34 +6,32 @@
 
 #include "vm/StringType-inl.h"
 
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/RangedPtr.h"
-#include "mozilla/TextUtils.h"
 #include "mozilla/TypeTraits.h"
 #include "mozilla/Unused.h"
 
 #include "gc/Marking.h"
 #include "gc/Nursery.h"
 #include "js/UbiNode.h"
 #include "util/StringBuffer.h"
 #include "vm/GeckoProfiler.h"
 
 #include "vm/GeckoProfiler-inl.h"
 #include "vm/JSCompartment-inl.h"
 #include "vm/JSContext-inl.h"
 #include "vm/JSObject-inl.h"
 
 using namespace js;
 
-using mozilla::IsAsciiDigit;
 using mozilla::IsNegativeZero;
 using mozilla::IsSame;
 using mozilla::PodCopy;
 using mozilla::PodEqual;
 using mozilla::RangedPtr;
 using mozilla::RoundUpPow2;
 using mozilla::Unused;
 
@@ -922,17 +920,17 @@ js::StringEqualsAscii(JSLinearString* st
 }
 
 template <typename CharT>
 /* static */ bool
 JSFlatString::isIndexSlow(const CharT* s, size_t length, uint32_t* indexp)
 {
     CharT ch = *s;
 
-    if (!IsAsciiDigit(ch))
+    if (!JS7_ISDEC(ch))
         return false;
 
     if (length > UINT32_CHAR_BUFFER_LENGTH)
         return false;
 
     /*
      * Make sure to account for the '\0' at the end of characters, dereferenced
      * in the loop below.
@@ -940,17 +938,17 @@ JSFlatString::isIndexSlow(const CharT* s
     RangedPtr<const CharT> cp(s, length + 1);
     const RangedPtr<const CharT> end(s + length, s, length + 1);
 
     uint32_t index = JS7_UNDEC(*cp++);
     uint32_t oldIndex = 0;
     uint32_t c = 0;
 
     if (index != 0) {
-        while (IsAsciiDigit(*cp)) {
+        while (JS7_ISDEC(*cp)) {
             oldIndex = index;
             c = JS7_UNDEC(*cp);
             index = 10 * index + c;
             cp++;
         }
     }
 
     /* It's not an element if there are characters after the number. */
--- a/js/src/vm/StringType.h
+++ b/js/src/vm/StringType.h
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef vm_StringType_h
 #define vm_StringType_h
 
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/Range.h"
-#include "mozilla/TextUtils.h"
 
 #include "jsapi.h"
 #include "jsfriendapi.h"
 
 #include "builtin/String.h"
 #include "gc/Barrier.h"
 #include "gc/Cell.h"
 #include "gc/Heap.h"
@@ -886,20 +885,20 @@ class JSFlatString : public JSLinearStri
     static inline JSFlatString* new_(JSContext* cx,
                                      const CharT* chars, size_t length);
 
     inline bool isIndexSlow(uint32_t* indexp) const {
         MOZ_ASSERT(JSString::isFlat());
         JS::AutoCheckCannotGC nogc;
         if (hasLatin1Chars()) {
             const JS::Latin1Char* s = latin1Chars(nogc);
-            return mozilla::IsAsciiDigit(*s) && isIndexSlow(s, length(), indexp);
+            return JS7_ISDEC(*s) && isIndexSlow(s, length(), indexp);
         }
         const char16_t* s = twoByteChars(nogc);
-        return mozilla::IsAsciiDigit(*s) && isIndexSlow(s, length(), indexp);
+        return JS7_ISDEC(*s) && isIndexSlow(s, length(), indexp);
     }
 
     /*
      * Returns true if this string's characters store an unsigned 32-bit
      * integer value, initializing *indexp to that value if so.  (Thus if
      * calling isIndex returns true, js::IndexToString(cx, *indexp) will be a
      * string equal to this string.)
      */
--- a/js/src/vm/TypedArrayObject.cpp
+++ b/js/src/vm/TypedArrayObject.cpp
@@ -6,17 +6,16 @@
 
 #include "vm/TypedArrayObject-inl.h"
 #include "vm/TypedArrayObject.h"
 
 #include "mozilla/Alignment.h"
 #include "mozilla/Casting.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/PodOperations.h"
-#include "mozilla/TextUtils.h"
 
 #include <string.h>
 #ifndef XP_WIN
 # include <sys/mman.h>
 #endif
 
 #include "jsapi.h"
 #include "jsnum.h"
@@ -48,17 +47,16 @@
 #include "vm/JSAtom-inl.h"
 #include "vm/NativeObject-inl.h"
 #include "vm/Shape-inl.h"
 
 using namespace js;
 using namespace js::gc;
 
 using mozilla::AssertedCast;
-using mozilla::IsAsciiDigit;
 using JS::CanonicalizeNaN;
 using JS::ToInt32;
 using JS::ToUint32;
 
 /*
  * TypedArrayObject
  *
  * The non-templated base class for the specific typed implementations.
@@ -2195,30 +2193,30 @@ js::StringIsTypedArrayIndex(const CharT*
 
     bool negative = false;
     if (*s == '-') {
         negative = true;
         if (++s == end)
             return false;
     }
 
-    if (!IsAsciiDigit(*s))
+    if (!JS7_ISDEC(*s))
         return false;
 
     uint64_t index = 0;
     uint32_t digit = JS7_UNDEC(*s++);
 
     /* Don't allow leading zeros. */
     if (digit == 0 && s != end)
         return false;
 
     index = digit;
 
     for (; s < end; s++) {
-        if (!IsAsciiDigit(*s))
+        if (!JS7_ISDEC(*s))
             return false;
 
         digit = JS7_UNDEC(*s);
 
         /* Watch for overflows. */
         if ((UINT64_MAX - digit) / 10 < index)
             index = UINT64_MAX;
         else
--- a/js/src/vm/TypedArrayObject.h
+++ b/js/src/vm/TypedArrayObject.h
@@ -3,17 +3,16 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef vm_TypedArrayObject_h
 #define vm_TypedArrayObject_h
 
 #include "mozilla/Attributes.h"
-#include "mozilla/TextUtils.h"
 
 #include "gc/Barrier.h"
 #include "js/Class.h"
 #include "vm/ArrayBufferObject.h"
 #include "vm/JSObject.h"
 #include "vm/SharedArrayObject.h"
 
 #define JS_FOR_EACH_TYPED_ARRAY(macro) \
@@ -357,23 +356,23 @@ IsTypedArrayIndex(jsid id, uint64_t* ind
         return false;
 
     JS::AutoCheckCannotGC nogc;
     JSAtom* atom = JSID_TO_ATOM(id);
     size_t length = atom->length();
 
     if (atom->hasLatin1Chars()) {
         const Latin1Char* s = atom->latin1Chars(nogc);
-        if (!mozilla::IsAsciiDigit(*s) && *s != '-')
+        if (!JS7_ISDEC(*s) && *s != '-')
             return false;
         return StringIsTypedArrayIndex(s, length, indexp);
     }
 
     const char16_t* s = atom->twoByteChars(nogc);
-    if (!mozilla::IsAsciiDigit(*s) && *s != '-')
+    if (!JS7_ISDEC(*s) && *s != '-')
         return false;
     return StringIsTypedArrayIndex(s, length, indexp);
 }
 
 /*
  * Implements [[DefineOwnProperty]] for TypedArrays when the property
  * key is a TypedArray index.
  */
--- a/layout/mathml/nsMathMLmpaddedFrame.cpp
+++ b/layout/mathml/nsMathMLmpaddedFrame.cpp
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "nsMathMLmpaddedFrame.h"
 #include "nsMathMLElement.h"
 #include "mozilla/gfx/2D.h"
-#include "mozilla/TextUtils.h"
 #include <algorithm>
 
 //
 // <mpadded> -- adjust space around content - implementation
 //
 
 #define NS_MATHML_SIGN_INVALID           -1 // if the attribute is not there
 #define NS_MATHML_SIGN_UNSPECIFIED        0
@@ -156,17 +155,17 @@ nsMathMLmpaddedFrame::ParseAttribute(nsS
     if (gotDot && c == '.') {
       // error - two dots encountered
       aSign = NS_MATHML_SIGN_INVALID;
       return false;
     }
 
     if (c == '.')
       gotDot = true;
-    else if (!IsAsciiDigit(c)) {
+    else if (!nsCRT::IsAsciiDigit(c)) {
       break;
     }
     number.Append(c);
   }
 
   // catch error if we didn't enter the loop above... we could simply initialize
   // floatValue = 1, to cater for cases such as width="height", but that wouldn't
   // be in line with the spec which requires an explicit number
--- a/mfbt/TextUtils.h
+++ b/mfbt/TextUtils.h
@@ -32,107 +32,25 @@ class MakeUnsignedChar<char32_t>
 {
 public:
   using Type = char32_t;
 };
 
 } // namespace detail
 
 /**
- * Returns true iff |aChar| matches [a-z].
- *
- * This function is basically what you thought islower was, except its behavior
- * doesn't depend on the user's current locale.
- */
-template<typename Char>
-constexpr bool
-IsAsciiLowercaseAlpha(Char aChar)
-{
-  using UnsignedChar = typename detail::MakeUnsignedChar<Char>::Type;
-  auto uc = static_cast<UnsignedChar>(aChar);
-  return 'a' <= uc && uc <= 'z';
-}
-
-/**
- * Returns true iff |aChar| matches [A-Z].
- *
- * This function is basically what you thought isupper was, except its behavior
- * doesn't depend on the user's current locale.
- */
-template<typename Char>
-constexpr bool
-IsAsciiUppercaseAlpha(Char aChar)
-{
-  using UnsignedChar = typename detail::MakeUnsignedChar<Char>::Type;
-  auto uc = static_cast<UnsignedChar>(aChar);
-  return 'A' <= uc && uc <= 'Z';
-}
-
-/**
  * Returns true iff |aChar| matches [a-zA-Z].
  *
  * This function is basically what you thought isalpha was, except its behavior
  * doesn't depend on the user's current locale.
  */
 template<typename Char>
 constexpr bool
 IsAsciiAlpha(Char aChar)
 {
-  return IsAsciiLowercaseAlpha(aChar) || IsAsciiUppercaseAlpha(aChar);
-}
-
-/**
- * Returns true iff |aChar| matches [0-9].
- *
- * This function is basically what you thought isdigit was, except its behavior
- * doesn't depend on the user's current locale.
- */
-template<typename Char>
-constexpr bool
-IsAsciiDigit(Char aChar)
-{
   using UnsignedChar = typename detail::MakeUnsignedChar<Char>::Type;
   auto uc = static_cast<UnsignedChar>(aChar);
-  return '0' <= uc && uc <= '9';
-}
-
-/**
- * Returns true iff |aChar| matches [a-zA-Z0-9].
- *
- * This function is basically what you thought isalnum was, except its behavior
- * doesn't depend on the user's current locale.
- */
-template<typename Char>
-constexpr bool
-IsAsciiAlphanumeric(Char aChar)
-{
-  return IsAsciiDigit(aChar) || IsAsciiAlpha(aChar);
-}
-
-/**
- * Converts an ASCII alphanumeric digit [0-9a-zA-Z] to number as if in base-36.
- * (This function therefore works for decimal, hexadecimal, etc.).
- */
-template<typename Char>
-constexpr uint8_t
-AsciiAlphanumericToNumber(Char aChar)
-{
-  using UnsignedChar = typename detail::MakeUnsignedChar<Char>::Type;
-  auto uc = static_cast<UnsignedChar>(aChar);
-
-  if ('0' <= uc && uc <= '9') {
-    return aChar - '0';
-  }
-
-  if ('A' <= uc && uc <= 'Z') {
-    return aChar - 'A' + 10;
-  }
-
-  // The division here compile-time-enforces an IsAsciiAlphanumeric assertion
-  // when possible in constexpr context and in runtime context does the
-  // next-best thing.  (C++17 |if constexpr| is really what we want for this to
-  // allow a proper |MOZ_ASSERT|.)
-  return (aChar - 'a' + 10) / ('a' <= uc && uc <= 'z');
+  return ('a' <= uc && uc <= 'z') || ('A' <= uc && uc <= 'Z');
 }
 
 } // namespace mozilla
 
 #endif /* mozilla_TextUtils_h */
--- a/mfbt/tests/TestTextUtils.cpp
+++ b/mfbt/tests/TestTextUtils.cpp
@@ -2,715 +2,105 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Assertions.h"
 #include "mozilla/TextUtils.h"
 
-using mozilla::AsciiAlphanumericToNumber;
 using mozilla::IsAsciiAlpha;
-using mozilla::IsAsciiAlphanumeric;
-using mozilla::IsAsciiDigit;
-using mozilla::IsAsciiLowercaseAlpha;
-using mozilla::IsAsciiUppercaseAlpha;
-
-static void
-TestIsAsciiAlpha()
-{
-  // char
-
-  static_assert(!IsAsciiAlpha('@'), "'@' isn't ASCII alpha");
-  static_assert('@' == 0x40, "'@' has value 0x40");
-
-  static_assert('A' == 0x41, "'A' has value 0x41");
-  static_assert(IsAsciiAlpha('A'), "'A' is ASCII alpha");
-  static_assert(IsAsciiAlpha('B'), "'B' is ASCII alpha");
-  static_assert(IsAsciiAlpha('M'), "'M' is ASCII alpha");
-  static_assert(IsAsciiAlpha('Y'), "'Y' is ASCII alpha");
-  static_assert(IsAsciiAlpha('Z'), "'Z' is ASCII alpha");
-
-  static_assert('Z' == 0x5A, "'Z' has value 0x5A");
-  static_assert('[' == 0x5B, "'[' has value 0x5B");
-  static_assert(!IsAsciiAlpha('['), "'[' isn't ASCII alpha");
-
-  static_assert(!IsAsciiAlpha('`'), "'`' isn't ASCII alpha");
-  static_assert('`' == 0x60, "'`' has value 0x60");
-
-  static_assert('a' == 0x61, "'a' has value 0x61");
-  static_assert(IsAsciiAlpha('a'), "'a' is ASCII alpha");
-  static_assert(IsAsciiAlpha('b'), "'b' is ASCII alpha");
-  static_assert(IsAsciiAlpha('m'), "'m' is ASCII alpha");
-  static_assert(IsAsciiAlpha('y'), "'y' is ASCII alpha");
-  static_assert(IsAsciiAlpha('z'), "'z' is ASCII alpha");
 
-  static_assert('z' == 0x7A, "'z' has value 0x7A");
-  static_assert('{' == 0x7B, "'{' has value 0x7B");
-  static_assert(!IsAsciiAlpha('{'), "'{' isn't ASCII alpha");
-
-  static_assert(!IsAsciiAlpha('5'), "'5' isn't ASCII alpha");
-
-  // char16_t
-
-  static_assert(!IsAsciiAlpha(u'@'), "u'@' isn't ASCII alpha");
-  static_assert(u'@' == 0x40, "u'@' has value 0x40");
-
-  static_assert(u'A' == 0x41, "u'A' has value 0x41");
-  static_assert(IsAsciiAlpha(u'A'), "u'A' is ASCII alpha");
-  static_assert(IsAsciiAlpha(u'B'), "u'B' is ASCII alpha");
-  static_assert(IsAsciiAlpha(u'M'), "u'M' is ASCII alpha");
-  static_assert(IsAsciiAlpha(u'Y'), "u'Y' is ASCII alpha");
-  static_assert(IsAsciiAlpha(u'Z'), "u'Z' is ASCII alpha");
+// char
 
-  static_assert(u'Z' == 0x5A, "u'Z' has value 0x5A");
-  static_assert(u'[' == 0x5B, "u'[' has value 0x5B");
-  static_assert(!IsAsciiAlpha(u'['), "u'[' isn't ASCII alpha");
-
-  static_assert(!IsAsciiAlpha(u'`'), "u'`' isn't ASCII alpha");
-  static_assert(u'`' == 0x60, "u'`' has value 0x60");
-
-  static_assert(u'a' == 0x61, "u'a' has value 0x61");
-  static_assert(IsAsciiAlpha(u'a'), "u'a' is ASCII alpha");
-  static_assert(IsAsciiAlpha(u'b'), "u'b' is ASCII alpha");
-  static_assert(IsAsciiAlpha(u'm'), "u'm' is ASCII alpha");
-  static_assert(IsAsciiAlpha(u'y'), "u'y' is ASCII alpha");
-  static_assert(IsAsciiAlpha(u'z'), "u'z' is ASCII alpha");
-
-  static_assert(u'z' == 0x7A, "u'z' has value 0x7A");
-  static_assert(u'{' == 0x7B, "u'{' has value 0x7B");
-  static_assert(!IsAsciiAlpha(u'{'), "u'{' isn't ASCII alpha");
-
-  static_assert(!IsAsciiAlpha(u'5'), "u'5' isn't ASCII alpha");
-
-  // char32_t
-
-  static_assert(!IsAsciiAlpha(U'@'), "U'@' isn't ASCII alpha");
-  static_assert(U'@' == 0x40, "U'@' has value 0x40");
+static_assert(!IsAsciiAlpha('@'), "'@' isn't ASCII alpha");
+static_assert('@' == 0x40, "'@' has value 0x40");
 
-  static_assert(U'A' == 0x41, "U'A' has value 0x41");
-  static_assert(IsAsciiAlpha(U'A'), "U'A' is ASCII alpha");
-  static_assert(IsAsciiAlpha(U'B'), "U'B' is ASCII alpha");
-  static_assert(IsAsciiAlpha(U'M'), "U'M' is ASCII alpha");
-  static_assert(IsAsciiAlpha(U'Y'), "U'Y' is ASCII alpha");
-  static_assert(IsAsciiAlpha(U'Z'), "U'Z' is ASCII alpha");
-
-  static_assert(U'Z' == 0x5A, "U'Z' has value 0x5A");
-  static_assert(U'[' == 0x5B, "U'[' has value 0x5B");
-  static_assert(!IsAsciiAlpha(U'['), "U'[' isn't ASCII alpha");
-
-  static_assert(!IsAsciiAlpha(U'`'), "U'`' isn't ASCII alpha");
-  static_assert(U'`' == 0x60, "U'`' has value 0x60");
-
-  static_assert(U'a' == 0x61, "U'a' has value 0x61");
-  static_assert(IsAsciiAlpha(U'a'), "U'a' is ASCII alpha");
-  static_assert(IsAsciiAlpha(U'b'), "U'b' is ASCII alpha");
-  static_assert(IsAsciiAlpha(U'm'), "U'm' is ASCII alpha");
-  static_assert(IsAsciiAlpha(U'y'), "U'y' is ASCII alpha");
-  static_assert(IsAsciiAlpha(U'z'), "U'z' is ASCII alpha");
-
-  static_assert(U'z' == 0x7A, "U'z' has value 0x7A");
-  static_assert(U'{' == 0x7B, "U'{' has value 0x7B");
-  static_assert(!IsAsciiAlpha(U'{'), "U'{' isn't ASCII alpha");
-
-  static_assert(!IsAsciiAlpha(U'5'), "U'5' isn't ASCII alpha");
-}
-
-static void
-TestIsAsciiUppercaseAlpha()
-{
-  // char
-
-  static_assert(!IsAsciiUppercaseAlpha('@'), "'@' isn't ASCII alpha uppercase");
-  static_assert('@' == 0x40, "'@' has value 0x40");
-
-  static_assert('A' == 0x41, "'A' has value 0x41");
-  static_assert(IsAsciiUppercaseAlpha('A'), "'A' is ASCII alpha uppercase");
-  static_assert(IsAsciiUppercaseAlpha('B'), "'B' is ASCII alpha uppercase");
-  static_assert(IsAsciiUppercaseAlpha('M'), "'M' is ASCII alpha uppercase");
-  static_assert(IsAsciiUppercaseAlpha('Y'), "'Y' is ASCII alpha uppercase");
-  static_assert(IsAsciiUppercaseAlpha('Z'), "'Z' is ASCII alpha uppercase");
+static_assert('A' == 0x41, "'A' has value 0x41");
+static_assert(IsAsciiAlpha('A'), "'A' is ASCII alpha");
+static_assert(IsAsciiAlpha('B'), "'B' is ASCII alpha");
+static_assert(IsAsciiAlpha('M'), "'M' is ASCII alpha");
+static_assert(IsAsciiAlpha('Y'), "'Y' is ASCII alpha");
+static_assert(IsAsciiAlpha('Z'), "'Z' is ASCII alpha");
 
-  static_assert('Z' == 0x5A, "'Z' has value 0x5A");
-  static_assert('[' == 0x5B, "'[' has value 0x5B");
-  static_assert(!IsAsciiUppercaseAlpha('['), "'[' isn't ASCII alpha uppercase");
-
-  static_assert(!IsAsciiUppercaseAlpha('`'), "'`' isn't ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha('a'), "'a' is ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha('b'), "'b' is ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha('m'), "'m' is ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha('y'), "'y' is ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha('z'), "'z' is ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha('{'), "'{' isn't ASCII alpha uppercase");
-
-  // char16_t
-
-  static_assert(!IsAsciiUppercaseAlpha(u'@'), "u'@' isn't ASCII alpha uppercase");
-  static_assert(u'@' == 0x40, "u'@' has value 0x40");
-
-  static_assert(u'A' == 0x41, "u'A' has value 0x41");
-  static_assert(IsAsciiUppercaseAlpha(u'A'), "u'A' is ASCII alpha uppercase");
-  static_assert(IsAsciiUppercaseAlpha(u'B'), "u'B' is ASCII alpha uppercase");
-  static_assert(IsAsciiUppercaseAlpha(u'M'), "u'M' is ASCII alpha uppercase");
-  static_assert(IsAsciiUppercaseAlpha(u'Y'), "u'Y' is ASCII alpha uppercase");
-  static_assert(IsAsciiUppercaseAlpha(u'Z'), "u'Z' is ASCII alpha uppercase");
+static_assert('Z' == 0x5A, "'Z' has value 0x5A");
+static_assert('[' == 0x5B, "'[' has value 0x5B");
+static_assert(!IsAsciiAlpha('['), "'[' isn't ASCII alpha");
 
-  static_assert(u'Z' == 0x5A, "u'Z' has value 0x5A");
-  static_assert(u'[' == 0x5B, "u'[' has value 0x5B");
-  static_assert(!IsAsciiUppercaseAlpha(u'['), "u'[' isn't ASCII alpha uppercase");
-
-  static_assert(!IsAsciiUppercaseAlpha(u'`'), "u'`' isn't ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha(u'a'), "u'a' is ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha(u'b'), "u'b' is ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha(u'm'), "u'm' is ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha(u'y'), "u'y' is ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha(u'z'), "u'z' is ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha(u'{'), "u'{' isn't ASCII alpha uppercase");
-
-  // char32_t
-
-  static_assert(!IsAsciiUppercaseAlpha(U'@'), "U'@' isn't ASCII alpha uppercase");
-  static_assert(U'@' == 0x40, "U'@' has value 0x40");
-
-  static_assert(U'A' == 0x41, "U'A' has value 0x41");
-  static_assert(IsAsciiUppercaseAlpha(U'A'), "U'A' is ASCII alpha uppercase");
-  static_assert(IsAsciiUppercaseAlpha(U'B'), "U'B' is ASCII alpha uppercase");
-  static_assert(IsAsciiUppercaseAlpha(U'M'), "U'M' is ASCII alpha uppercase");
-  static_assert(IsAsciiUppercaseAlpha(U'Y'), "U'Y' is ASCII alpha uppercase");
-  static_assert(IsAsciiUppercaseAlpha(U'Z'), "U'Z' is ASCII alpha uppercase");
+static_assert(!IsAsciiAlpha('`'), "'`' isn't ASCII alpha");
+static_assert('`' == 0x60, "'`' has value 0x60");
 
-  static_assert(U'Z' == 0x5A, "U'Z' has value 0x5A");
-  static_assert(U'[' == 0x5B, "U'[' has value 0x5B");
-  static_assert(!IsAsciiUppercaseAlpha(U'['), "U'[' isn't ASCII alpha uppercase");
-
-  static_assert(!IsAsciiUppercaseAlpha(U'`'), "U'`' isn't ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha(U'a'), "U'a' is ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha(U'b'), "U'b' is ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha(U'm'), "U'm' is ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha(U'y'), "U'y' is ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha(U'z'), "U'z' is ASCII alpha uppercase");
-  static_assert(!IsAsciiUppercaseAlpha(U'{'), "U'{' isn't ASCII alpha uppercase");
-}
-
-static void
-TestIsAsciiLowercaseAlpha()
-{
-  // char
-
-  static_assert(!IsAsciiLowercaseAlpha('`'), "'`' isn't ASCII alpha lowercase");
-  static_assert('`' == 0x60, "'`' has value 0x60");
-
-  static_assert('a' == 0x61, "'a' has value 0x61");
-  static_assert(IsAsciiLowercaseAlpha('a'), "'a' is ASCII alpha lowercase");
-  static_assert(IsAsciiLowercaseAlpha('b'), "'b' is ASCII alpha lowercase");
-  static_assert(IsAsciiLowercaseAlpha('m'), "'m' is ASCII alpha lowercase");
-  static_assert(IsAsciiLowercaseAlpha('y'), "'y' is ASCII alpha lowercase");
-  static_assert(IsAsciiLowercaseAlpha('z'), "'z' is ASCII alpha lowercase");
-
-  static_assert('z' == 0x7A, "'z' has value 0x7A");
-  static_assert('{' == 0x7B, "'{' has value 0x7B");
-  static_assert(!IsAsciiLowercaseAlpha('{'), "'{' isn't ASCII alpha lowercase");
-
-  static_assert(!IsAsciiLowercaseAlpha('@'), "'@' isn't ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha('A'), "'A' is ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha('B'), "'B' is ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha('M'), "'M' is ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha('Y'), "'Y' is ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha('Z'), "'Z' is ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha('['), "'[' isn't ASCII alpha lowercase");
+static_assert('a' == 0x61, "'a' has value 0x61");
+static_assert(IsAsciiAlpha('a'), "'a' is ASCII alpha");
+static_assert(IsAsciiAlpha('b'), "'b' is ASCII alpha");
+static_assert(IsAsciiAlpha('m'), "'m' is ASCII alpha");
+static_assert(IsAsciiAlpha('y'), "'y' is ASCII alpha");
+static_assert(IsAsciiAlpha('z'), "'z' is ASCII alpha");
 
-  // char16_t
-
-  static_assert(!IsAsciiLowercaseAlpha(u'`'), "u'`' isn't ASCII alpha lowercase");
-  static_assert(u'`' == 0x60, "u'`' has value 0x60");
-
-  static_assert(u'a' == 0x61, "u'a' has value 0x61");
-  static_assert(IsAsciiLowercaseAlpha(u'a'), "u'a' is ASCII alpha lowercase");
-  static_assert(IsAsciiLowercaseAlpha(u'b'), "u'b' is ASCII alpha lowercase");
-  static_assert(IsAsciiLowercaseAlpha(u'm'), "u'm' is ASCII alpha lowercase");
-  static_assert(IsAsciiLowercaseAlpha(u'y'), "u'y' is ASCII alpha lowercase");
-  static_assert(IsAsciiLowercaseAlpha(u'z'), "u'z' is ASCII alpha lowercase");
-
-  static_assert(u'z' == 0x7A, "u'z' has value 0x7A");
-  static_assert(u'{' == 0x7B, "u'{' has value 0x7B");
-  static_assert(!IsAsciiLowercaseAlpha(u'{'), "u'{' isn't ASCII alpha lowercase");
-
-  static_assert(!IsAsciiLowercaseAlpha(u'@'), "u'@' isn't ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha(u'A'), "u'A' is ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha(u'B'), "u'B' is ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha(u'M'), "u'M' is ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha(u'Y'), "u'Y' is ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha(u'Z'), "u'Z' is ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha(u'['), "u'[' isn't ASCII alpha lowercase");
-
-  // char32_t
-
-  static_assert(!IsAsciiLowercaseAlpha(U'`'), "U'`' isn't ASCII alpha lowercase");
-  static_assert(U'`' == 0x60, "U'`' has value 0x60");
-
-  static_assert(U'a' == 0x61, "U'a' has value 0x61");
-  static_assert(IsAsciiLowercaseAlpha(U'a'), "U'a' is ASCII alpha lowercase");
-  static_assert(IsAsciiLowercaseAlpha(U'b'), "U'b' is ASCII alpha lowercase");
-  static_assert(IsAsciiLowercaseAlpha(U'm'), "U'm' is ASCII alpha lowercase");
-  static_assert(IsAsciiLowercaseAlpha(U'y'), "U'y' is ASCII alpha lowercase");
-  static_assert(IsAsciiLowercaseAlpha(U'z'), "U'z' is ASCII alpha lowercase");
-
-  static_assert(U'z' == 0x7A, "U'z' has value 0x7A");
-  static_assert(U'{' == 0x7B, "U'{' has value 0x7B");
-  static_assert(!IsAsciiLowercaseAlpha(U'{'), "U'{' isn't ASCII alpha lowercase");
+static_assert('z' == 0x7A, "'z' has value 0x7A");
+static_assert('{' == 0x7B, "'{' has value 0x7B");
+static_assert(!IsAsciiAlpha('{'), "'{' isn't ASCII alpha");
 
-  static_assert(!IsAsciiLowercaseAlpha(U'@'), "U'@' isn't ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha(U'A'), "U'A' is ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha(U'B'), "U'B' is ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha(U'M'), "U'M' is ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha(U'Y'), "U'Y' is ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha(U'Z'), "U'Z' is ASCII alpha lowercase");
-  static_assert(!IsAsciiLowercaseAlpha(U'['), "U'[' isn't ASCII alpha lowercase");
-}
-
-static void
-TestIsAsciiAlphanumeric()
-{
-  // char
-
-  static_assert(!IsAsciiAlphanumeric('/'), "'/' isn't ASCII alphanumeric");
-  static_assert('/' == 0x2F, "'/' has value 0x2F");
+// char16_t
 
-  static_assert('0' == 0x30, "'0' has value 0x30");
-  static_assert(IsAsciiAlphanumeric('0'), "'0' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric('1'), "'1' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric('5'), "'5' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric('8'), "'8' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric('9'), "'9' is ASCII alphanumeric");
-
-  static_assert('9' == 0x39, "'9' has value 0x39");
-  static_assert(':' == 0x3A, "':' has value 0x3A");
-  static_assert(!IsAsciiAlphanumeric(':'), "':' isn't ASCII alphanumeric");
-
-  static_assert(!IsAsciiAlphanumeric('@'), "'@' isn't ASCII alphanumeric");
-  static_assert('@' == 0x40, "'@' has value 0x40");
-
-  static_assert('A' == 0x41, "'A' has value 0x41");
-  static_assert(IsAsciiAlphanumeric('A'), "'A' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric('B'), "'B' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric('M'), "'M' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric('Y'), "'Y' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric('Z'), "'Z' is ASCII alphanumeric");
-
-  static_assert('Z' == 0x5A, "'Z' has value 0x5A");
-  static_assert('[' == 0x5B, "'[' has value 0x5B");
-  static_assert(!IsAsciiAlphanumeric('['), "'[' isn't ASCII alphanumeric");
-
-  static_assert(!IsAsciiAlphanumeric('`'), "'`' isn't ASCII alphanumeric");
-  static_assert('`' == 0x60, "'`' has value 0x60");
+static_assert(!IsAsciiAlpha(u'@'), "u'@' isn't ASCII alpha");
+static_assert(u'@' == 0x40, "u'@' has value 0x40");
 
-  static_assert('a' == 0x61, "'a' has value 0x61");
-  static_assert(IsAsciiAlphanumeric('a'), "'a' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric('b'), "'b' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric('m'), "'m' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric('y'), "'y' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric('z'), "'z' is ASCII alphanumeric");
-
-  static_assert('z' == 0x7A, "'z' has value 0x7A");
-  static_assert('{' == 0x7B, "'{' has value 0x7B");
-  static_assert(!IsAsciiAlphanumeric('{'), "'{' isn't ASCII alphanumeric");
-
-  // char16_t
-
-  static_assert(!IsAsciiAlphanumeric(u'/'), "u'/' isn't ASCII alphanumeric");
-  static_assert(u'/' == 0x2F, "u'/' has value 0x2F");
-
-  static_assert(u'0' == 0x30, "u'0' has value 0x30");
-  static_assert(IsAsciiAlphanumeric(u'0'), "u'0' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(u'1'), "u'1' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(u'5'), "u'5' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(u'8'), "u'8' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(u'9'), "u'9' is ASCII alphanumeric");
-
-  static_assert(u'9' == 0x39, "u'9' has value 0x39");
-  static_assert(u':' == 0x3A, "u':' has value 0x3A");
-  static_assert(!IsAsciiAlphanumeric(u':'), "u':' isn't ASCII alphanumeric");
-
-  static_assert(!IsAsciiAlphanumeric(u'@'), "u'@' isn't ASCII alphanumeric");
-  static_assert(u'@' == 0x40, "u'@' has value 0x40");
-
-  static_assert(u'A' == 0x41, "u'A' has value 0x41");
-  static_assert(IsAsciiAlphanumeric(u'A'), "u'A' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(u'B'), "u'B' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(u'M'), "u'M' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(u'Y'), "u'Y' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(u'Z'), "u'Z' is ASCII alphanumeric");
-
-  static_assert(u'Z' == 0x5A, "u'Z' has value 0x5A");
-  static_assert(u'[' == 0x5B, "u'[' has value 0x5B");
-  static_assert(!IsAsciiAlphanumeric(u'['), "u'[' isn't ASCII alphanumeric");
-
-  static_assert(!IsAsciiAlphanumeric(u'`'), "u'`' isn't ASCII alphanumeric");
-  static_assert(u'`' == 0x60, "u'`' has value 0x60");
-
-  static_assert(u'a' == 0x61, "u'a' has value 0x61");
-  static_assert(IsAsciiAlphanumeric(u'a'), "u'a' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(u'b'), "u'b' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(u'm'), "u'm' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(u'y'), "u'y' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(u'z'), "u'z' is ASCII alphanumeric");
+static_assert(u'A' == 0x41, "u'A' has value 0x41");
+static_assert(IsAsciiAlpha(u'A'), "u'A' is ASCII alpha");
+static_assert(IsAsciiAlpha(u'B'), "u'B' is ASCII alpha");
+static_assert(IsAsciiAlpha(u'M'), "u'M' is ASCII alpha");
+static_assert(IsAsciiAlpha(u'Y'), "u'Y' is ASCII alpha");
+static_assert(IsAsciiAlpha(u'Z'), "u'Z' is ASCII alpha");
 
-  static_assert(u'z' == 0x7A, "u'z' has value 0x7A");
-  static_assert(u'{' == 0x7B, "u'{' has value 0x7B");
-  static_assert(!IsAsciiAlphanumeric(u'{'), "u'{' isn't ASCII alphanumeric");
-
-  // char32_t
-
-  static_assert(!IsAsciiAlphanumeric(U'/'), "U'/' isn't ASCII alphanumeric");
-  static_assert(U'/' == 0x2F, "U'/' has value 0x2F");
-
-  static_assert(U'0' == 0x30, "U'0' has value 0x30");
-  static_assert(IsAsciiAlphanumeric(U'0'), "U'0' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(U'1'), "U'1' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(U'5'), "U'5' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(U'8'), "U'8' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(U'9'), "U'9' is ASCII alphanumeric");
-
-  static_assert(U'9' == 0x39, "U'9' has value 0x39");
-  static_assert(U':' == 0x3A, "U':' has value 0x3A");
-  static_assert(!IsAsciiAlphanumeric(U':'), "U':' isn't ASCII alphanumeric");
-
-  static_assert(!IsAsciiAlphanumeric(U'@'), "U'@' isn't ASCII alphanumeric");
-  static_assert(U'@' == 0x40, "U'@' has value 0x40");
-
-  static_assert(U'A' == 0x41, "U'A' has value 0x41");
-  static_assert(IsAsciiAlphanumeric(U'A'), "U'A' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(U'B'), "U'B' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(U'M'), "U'M' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(U'Y'), "U'Y' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(U'Z'), "U'Z' is ASCII alphanumeric");
+static_assert(u'Z' == 0x5A, "u'Z' has value 0x5A");
+static_assert(u'[' == 0x5B, "u'[' has value 0x5B");
+static_assert(!IsAsciiAlpha(u'['), "u'[' isn't ASCII alpha");
 
-  static_assert(U'Z' == 0x5A, "U'Z' has value 0x5A");
-  static_assert(U'[' == 0x5B, "U'[' has value 0x5B");
-  static_assert(!IsAsciiAlphanumeric(U'['), "U'[' isn't ASCII alphanumeric");
-
-  static_assert(!IsAsciiAlphanumeric(U'`'), "U'`' isn't ASCII alphanumeric");
-  static_assert(U'`' == 0x60, "U'`' has value 0x60");
-
-  static_assert(U'a' == 0x61, "U'a' has value 0x61");
-  static_assert(IsAsciiAlphanumeric(U'a'), "U'a' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(U'b'), "U'b' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(U'm'), "U'm' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(U'y'), "U'y' is ASCII alphanumeric");
-  static_assert(IsAsciiAlphanumeric(U'z'), "U'z' is ASCII alphanumeric");
-
-  static_assert(U'z' == 0x7A, "U'z' has value 0x7A");
-  static_assert(U'{' == 0x7B, "U'{' has value 0x7B");
-  static_assert(!IsAsciiAlphanumeric(U'{'), "U'{' isn't ASCII alphanumeric");
-}
-
-static void
-TestAsciiAlphanumericToNumber()
-{
-  // char
-
-  static_assert(AsciiAlphanumericToNumber('0') == 0, "'0' converts to 0");
-  static_assert(AsciiAlphanumericToNumber('1') == 1, "'1' converts to 1");
-  static_assert(AsciiAlphanumericToNumber('2') == 2, "'2' converts to 2");
-  static_assert(AsciiAlphanumericToNumber('3') == 3, "'3' converts to 3");
-  static_assert(AsciiAlphanumericToNumber('4') == 4, "'4' converts to 4");
-  static_assert(AsciiAlphanumericToNumber('5') == 5, "'5' converts to 5");
-  static_assert(AsciiAlphanumericToNumber('6') == 6, "'6' converts to 6");
-  static_assert(AsciiAlphanumericToNumber('7') == 7, "'7' converts to 7");
-  static_assert(AsciiAlphanumericToNumber('8') == 8, "'8' converts to 8");
-  static_assert(AsciiAlphanumericToNumber('9') == 9, "'9' converts to 9");
+static_assert(!IsAsciiAlpha(u'`'), "u'`' isn't ASCII alpha");
+static_assert(u'`' == 0x60, "u'`' has value 0x60");
 
-  static_assert(AsciiAlphanumericToNumber('A') == 10, "'A' converts to 10");
-  static_assert(AsciiAlphanumericToNumber('B') == 11, "'B' converts to 11");
-  static_assert(AsciiAlphanumericToNumber('C') == 12, "'C' converts to 12");
-  static_assert(AsciiAlphanumericToNumber('D') == 13, "'D' converts to 13");
-  static_assert(AsciiAlphanumericToNumber('E') == 14, "'E' converts to 14");
-  static_assert(AsciiAlphanumericToNumber('F') == 15, "'F' converts to 15");
-  static_assert(AsciiAlphanumericToNumber('G') == 16, "'G' converts to 16");
-  static_assert(AsciiAlphanumericToNumber('H') == 17, "'H' converts to 17");
-  static_assert(AsciiAlphanumericToNumber('I') == 18, "'I' converts to 18");
-  static_assert(AsciiAlphanumericToNumber('J') == 19, "'J' converts to 19");
-  static_assert(AsciiAlphanumericToNumber('K') == 20, "'K' converts to 20");
-  static_assert(AsciiAlphanumericToNumber('L') == 21, "'L' converts to 21");
-  static_assert(AsciiAlphanumericToNumber('M') == 22, "'M' converts to 22");
-  static_assert(AsciiAlphanumericToNumber('N') == 23, "'N' converts to 23");
-  static_assert(AsciiAlphanumericToNumber('O') == 24, "'O' converts to 24");
-  static_assert(AsciiAlphanumericToNumber('P') == 25, "'P' converts to 25");
-  static_assert(AsciiAlphanumericToNumber('Q') == 26, "'Q' converts to 26");
-  static_assert(AsciiAlphanumericToNumber('R') == 27, "'R' converts to 27");
-  static_assert(AsciiAlphanumericToNumber('S') == 28, "'S' converts to 28");
-  static_assert(AsciiAlphanumericToNumber('T') == 29, "'T' converts to 29");
-  static_assert(AsciiAlphanumericToNumber('U') == 30, "'U' converts to 30");
-  static_assert(AsciiAlphanumericToNumber('V') == 31, "'V' converts to 31");
-  static_assert(AsciiAlphanumericToNumber('W') == 32, "'W' converts to 32");
-  static_assert(AsciiAlphanumericToNumber('X') == 33, "'X' converts to 33");
-  static_assert(AsciiAlphanumericToNumber('Y') == 34, "'Y' converts to 34");
-  static_assert(AsciiAlphanumericToNumber('Z') == 35, "'Z' converts to 35");
+static_assert(u'a' == 0x61, "u'a' has value 0x61");
+static_assert(IsAsciiAlpha(u'a'), "u'a' is ASCII alpha");
+static_assert(IsAsciiAlpha(u'b'), "u'b' is ASCII alpha");
+static_assert(IsAsciiAlpha(u'm'), "u'm' is ASCII alpha");
+static_assert(IsAsciiAlpha(u'y'), "u'y' is ASCII alpha");
+static_assert(IsAsciiAlpha(u'z'), "u'z' is ASCII alpha");
 
-  static_assert(AsciiAlphanumericToNumber('a') == 10, "'a' converts to 10");
-  static_assert(AsciiAlphanumericToNumber('b') == 11, "'b' converts to 11");
-  static_assert(AsciiAlphanumericToNumber('c') == 12, "'c' converts to 12");
-  static_assert(AsciiAlphanumericToNumber('d') == 13, "'d' converts to 13");
-  static_assert(AsciiAlphanumericToNumber('e') == 14, "'e' converts to 14");
-  static_assert(AsciiAlphanumericToNumber('f') == 15, "'f' converts to 15");
-  static_assert(AsciiAlphanumericToNumber('g') == 16, "'g' converts to 16");
-  static_assert(AsciiAlphanumericToNumber('h') == 17, "'h' converts to 17");
-  static_assert(AsciiAlphanumericToNumber('i') == 18, "'i' converts to 18");
-  static_assert(AsciiAlphanumericToNumber('j') == 19, "'j' converts to 19");
-  static_assert(AsciiAlphanumericToNumber('k') == 20, "'k' converts to 20");
-  static_assert(AsciiAlphanumericToNumber('l') == 21, "'l' converts to 21");
-  static_assert(AsciiAlphanumericToNumber('m') == 22, "'m' converts to 22");
-  static_assert(AsciiAlphanumericToNumber('n') == 23, "'n' converts to 23");
-  static_assert(AsciiAlphanumericToNumber('o') == 24, "'o' converts to 24");
-  static_assert(AsciiAlphanumericToNumber('p') == 25, "'p' converts to 25");
-  static_assert(AsciiAlphanumericToNumber('q') == 26, "'q' converts to 26");
-  static_assert(AsciiAlphanumericToNumber('r') == 27, "'r' converts to 27");
-  static_assert(AsciiAlphanumericToNumber('s') == 28, "'s' converts to 28");
-  static_assert(AsciiAlphanumericToNumber('t') == 29, "'t' converts to 29");
-  static_assert(AsciiAlphanumericToNumber('u') == 30, "'u' converts to 30");
-  static_assert(AsciiAlphanumericToNumber('v') == 31, "'v' converts to 31");
-  static_assert(AsciiAlphanumericToNumber('w') == 32, "'w' converts to 32");
-  static_assert(AsciiAlphanumericToNumber('x') == 33, "'x' converts to 33");
-  static_assert(AsciiAlphanumericToNumber('y') == 34, "'y' converts to 34");
-  static_assert(AsciiAlphanumericToNumber('z') == 35, "'z' converts to 35");
-
-  // char16_t
+static_assert(u'z' == 0x7A, "u'z' has value 0x7A");
+static_assert(u'{' == 0x7B, "u'{' has value 0x7B");
+static_assert(!IsAsciiAlpha(u'{'), "u'{' isn't ASCII alpha");
 
-  static_assert(AsciiAlphanumericToNumber(u'0') == 0, "u'0' converts to 0");
-  static_assert(AsciiAlphanumericToNumber(u'1') == 1, "u'1' converts to 1");
-  static_assert(AsciiAlphanumericToNumber(u'2') == 2, "u'2' converts to 2");
-  static_assert(AsciiAlphanumericToNumber(u'3') == 3, "u'3' converts to 3");
-  static_assert(AsciiAlphanumericToNumber(u'4') == 4, "u'4' converts to 4");
-  static_assert(AsciiAlphanumericToNumber(u'5') == 5, "u'5' converts to 5");
-  static_assert(AsciiAlphanumericToNumber(u'6') == 6, "u'6' converts to 6");
-  static_assert(AsciiAlphanumericToNumber(u'7') == 7, "u'7' converts to 7");
-  static_assert(AsciiAlphanumericToNumber(u'8') == 8, "u'8' converts to 8");
-  static_assert(AsciiAlphanumericToNumber(u'9') == 9, "u'9' converts to 9");
+// char32_t
 
-  static_assert(AsciiAlphanumericToNumber(u'A') == 10, "u'A' converts to 10");
-  static_assert(AsciiAlphanumericToNumber(u'B') == 11, "u'B' converts to 11");
-  static_assert(AsciiAlphanumericToNumber(u'C') == 12, "u'C' converts to 12");
-  static_assert(AsciiAlphanumericToNumber(u'D') == 13, "u'D' converts to 13");
-  static_assert(AsciiAlphanumericToNumber(u'E') == 14, "u'E' converts to 14");
-  static_assert(AsciiAlphanumericToNumber(u'F') == 15, "u'F' converts to 15");
-  static_assert(AsciiAlphanumericToNumber(u'G') == 16, "u'G' converts to 16");
-  static_assert(AsciiAlphanumericToNumber(u'H') == 17, "u'H' converts to 17");
-  static_assert(AsciiAlphanumericToNumber(u'I') == 18, "u'I' converts to 18");
-  static_assert(AsciiAlphanumericToNumber(u'J') == 19, "u'J' converts to 19");
-  static_assert(AsciiAlphanumericToNumber(u'K') == 20, "u'K' converts to 20");
-  static_assert(AsciiAlphanumericToNumber(u'L') == 21, "u'L' converts to 21");
-  static_assert(AsciiAlphanumericToNumber(u'M') == 22, "u'M' converts to 22");
-  static_assert(AsciiAlphanumericToNumber(u'N') == 23, "u'N' converts to 23");
-  static_assert(AsciiAlphanumericToNumber(u'O') == 24, "u'O' converts to 24");
-  static_assert(AsciiAlphanumericToNumber(u'P') == 25, "u'P' converts to 25");
-  static_assert(AsciiAlphanumericToNumber(u'Q') == 26, "u'Q' converts to 26");
-  static_assert(AsciiAlphanumericToNumber(u'R') == 27, "u'R' converts to 27");
-  static_assert(AsciiAlphanumericToNumber(u'S') == 28, "u'S' converts to 28");
-  static_assert(AsciiAlphanumericToNumber(u'T') == 29, "u'T' converts to 29");
-  static_assert(AsciiAlphanumericToNumber(u'U') == 30, "u'U' converts to 30");
-  static_assert(AsciiAlphanumericToNumber(u'V') == 31, "u'V' converts to 31");
-  static_assert(AsciiAlphanumericToNumber(u'W') == 32, "u'W' converts to 32");
-  static_assert(AsciiAlphanumericToNumber(u'X') == 33, "u'X' converts to 33");
-  static_assert(AsciiAlphanumericToNumber(u'Y') == 34, "u'Y' converts to 34");
-  static_assert(AsciiAlphanumericToNumber(u'Z') == 35, "u'Z' converts to 35");
+static_assert(!IsAsciiAlpha(U'@'), "U'@' isn't ASCII alpha");
+static_assert(U'@' == 0x40, "U'@' has value 0x40");
 
-  static_assert(AsciiAlphanumericToNumber(u'a') == 10, "u'a' converts to 10");
-  static_assert(AsciiAlphanumericToNumber(u'b') == 11, "u'b' converts to 11");
-  static_assert(AsciiAlphanumericToNumber(u'c') == 12, "u'c' converts to 12");
-  static_assert(AsciiAlphanumericToNumber(u'd') == 13, "u'd' converts to 13");
-  static_assert(AsciiAlphanumericToNumber(u'e') == 14, "u'e' converts to 14");
-  static_assert(AsciiAlphanumericToNumber(u'f') == 15, "u'f' converts to 15");
-  static_assert(AsciiAlphanumericToNumber(u'g') == 16, "u'g' converts to 16");
-  static_assert(AsciiAlphanumericToNumber(u'h') == 17, "u'h' converts to 17");
-  static_assert(AsciiAlphanumericToNumber(u'i') == 18, "u'i' converts to 18");
-  static_assert(AsciiAlphanumericToNumber(u'j') == 19, "u'j' converts to 19");
-  static_assert(AsciiAlphanumericToNumber(u'k') == 20, "u'k' converts to 20");
-  static_assert(AsciiAlphanumericToNumber(u'l') == 21, "u'l' converts to 21");
-  static_assert(AsciiAlphanumericToNumber(u'm') == 22, "u'm' converts to 22");
-  static_assert(AsciiAlphanumericToNumber(u'n') == 23, "u'n' converts to 23");
-  static_assert(AsciiAlphanumericToNumber(u'o') == 24, "u'o' converts to 24");
-  static_assert(AsciiAlphanumericToNumber(u'p') == 25, "u'p' converts to 25");
-  static_assert(AsciiAlphanumericToNumber(u'q') == 26, "u'q' converts to 26");
-  static_assert(AsciiAlphanumericToNumber(u'r') == 27, "u'r' converts to 27");
-  static_assert(AsciiAlphanumericToNumber(u's') == 28, "u's' converts to 28");
-  static_assert(AsciiAlphanumericToNumber(u't') == 29, "u't' converts to 29");
-  static_assert(AsciiAlphanumericToNumber(u'u') == 30, "u'u' converts to 30");
-  static_assert(AsciiAlphanumericToNumber(u'v') == 31, "u'v' converts to 31");
-  static_assert(AsciiAlphanumericToNumber(u'w') == 32, "u'w' converts to 32");
-  static_assert(AsciiAlphanumericToNumber(u'x') == 33, "u'x' converts to 33");
-  static_assert(AsciiAlphanumericToNumber(u'y') == 34, "u'y' converts to 34");
-  static_assert(AsciiAlphanumericToNumber(u'z') == 35, "u'z' converts to 35");
-
-  // char32_t
-
-  static_assert(AsciiAlphanumericToNumber(U'0') == 0, "U'0' converts to 0");
-  static_assert(AsciiAlphanumericToNumber(U'1') == 1, "U'1' converts to 1");
-  static_assert(AsciiAlphanumericToNumber(U'2') == 2, "U'2' converts to 2");
-  static_assert(AsciiAlphanumericToNumber(U'3') == 3, "U'3' converts to 3");
-  static_assert(AsciiAlphanumericToNumber(U'4') == 4, "U'4' converts to 4");
-  static_assert(AsciiAlphanumericToNumber(U'5') == 5, "U'5' converts to 5");
-  static_assert(AsciiAlphanumericToNumber(U'6') == 6, "U'6' converts to 6");
-  static_assert(AsciiAlphanumericToNumber(U'7') == 7, "U'7' converts to 7");
-  static_assert(AsciiAlphanumericToNumber(U'8') == 8, "U'8' converts to 8");
-  static_assert(AsciiAlphanumericToNumber(U'9') == 9, "U'9' converts to 9");
+static_assert(U'A' == 0x41, "U'A' has value 0x41");
+static_assert(IsAsciiAlpha(U'A'), "U'A' is ASCII alpha");
+static_assert(IsAsciiAlpha(U'B'), "U'B' is ASCII alpha");
+static_assert(IsAsciiAlpha(U'M'), "U'M' is ASCII alpha");
+static_assert(IsAsciiAlpha(U'Y'), "U'Y' is ASCII alpha");
+static_assert(IsAsciiAlpha(U'Z'), "U'Z' is ASCII alpha");
 
-  static_assert(AsciiAlphanumericToNumber(U'A') == 10, "U'A' converts to 10");
-  static_assert(AsciiAlphanumericToNumber(U'B') == 11, "U'B' converts to 11");
-  static_assert(AsciiAlphanumericToNumber(U'C') == 12, "U'C' converts to 12");
-  static_assert(AsciiAlphanumericToNumber(U'D') == 13, "U'D' converts to 13");
-  static_assert(AsciiAlphanumericToNumber(U'E') == 14, "U'E' converts to 14");
-  static_assert(AsciiAlphanumericToNumber(U'F') == 15, "U'F' converts to 15");
-  static_assert(AsciiAlphanumericToNumber(U'G') == 16, "U'G' converts to 16");
-  static_assert(AsciiAlphanumericToNumber(U'H') == 17, "U'H' converts to 17");
-  static_assert(AsciiAlphanumericToNumber(U'I') == 18, "U'I' converts to 18");
-  static_assert(AsciiAlphanumericToNumber(U'J') == 19, "U'J' converts to 19");
-  static_assert(AsciiAlphanumericToNumber(U'K') == 20, "U'K' converts to 20");
-  static_assert(AsciiAlphanumericToNumber(U'L') == 21, "U'L' converts to 21");
-  static_assert(AsciiAlphanumericToNumber(U'M') == 22, "U'M' converts to 22");
-  static_assert(AsciiAlphanumericToNumber(U'N') == 23, "U'N' converts to 23");
-  static_assert(AsciiAlphanumericToNumber(U'O') == 24, "U'O' converts to 24");
-  static_assert(AsciiAlphanumericToNumber(U'P') == 25, "U'P' converts to 25");
-  static_assert(AsciiAlphanumericToNumber(U'Q') == 26, "U'Q' converts to 26");
-  static_assert(AsciiAlphanumericToNumber(U'R') == 27, "U'R' converts to 27");
-  static_assert(AsciiAlphanumericToNumber(U'S') == 28, "U'S' converts to 28");
-  static_assert(AsciiAlphanumericToNumber(U'T') == 29, "U'T' converts to 29");
-  static_assert(AsciiAlphanumericToNumber(U'U') == 30, "U'U' converts to 30");
-  static_assert(AsciiAlphanumericToNumber(U'V') == 31, "U'V' converts to 31");
-  static_assert(AsciiAlphanumericToNumber(U'W') == 32, "U'W' converts to 32");
-  static_assert(AsciiAlphanumericToNumber(U'X') == 33, "U'X' converts to 33");
-  static_assert(AsciiAlphanumericToNumber(U'Y') == 34, "U'Y' converts to 34");
-  static_assert(AsciiAlphanumericToNumber(U'Z') == 35, "U'Z' converts to 35");
-
-  static_assert(AsciiAlphanumericToNumber(U'a') == 10, "U'a' converts to 10");
-  static_assert(AsciiAlphanumericToNumber(U'b') == 11, "U'b' converts to 11");
-  static_assert(AsciiAlphanumericToNumber(U'c') == 12, "U'c' converts to 12");
-  static_assert(AsciiAlphanumericToNumber(U'd') == 13, "U'd' converts to 13");
-  static_assert(AsciiAlphanumericToNumber(U'e') == 14, "U'e' converts to 14");
-  static_assert(AsciiAlphanumericToNumber(U'f') == 15, "U'f' converts to 15");
-  static_assert(AsciiAlphanumericToNumber(U'g') == 16, "U'g' converts to 16");
-  static_assert(AsciiAlphanumericToNumber(U'h') == 17, "U'h' converts to 17");
-  static_assert(AsciiAlphanumericToNumber(U'i') == 18, "U'i' converts to 18");
-  static_assert(AsciiAlphanumericToNumber(U'j') == 19, "U'j' converts to 19");
-  static_assert(AsciiAlphanumericToNumber(U'k') == 20, "U'k' converts to 20");
-  static_assert(AsciiAlphanumericToNumber(U'l') == 21, "U'l' converts to 21");
-  static_assert(AsciiAlphanumericToNumber(U'm') == 22, "U'm' converts to 22");
-  static_assert(AsciiAlphanumericToNumber(U'n') == 23, "U'n' converts to 23");
-  static_assert(AsciiAlphanumericToNumber(U'o') == 24, "U'o' converts to 24");
-  static_assert(AsciiAlphanumericToNumber(U'p') == 25, "U'p' converts to 25");
-  static_assert(AsciiAlphanumericToNumber(U'q') == 26, "U'q' converts to 26");
-  static_assert(AsciiAlphanumericToNumber(U'r') == 27, "U'r' converts to 27");
-  static_assert(AsciiAlphanumericToNumber(U's') == 28, "U's' converts to 28");
-  static_assert(AsciiAlphanumericToNumber(U't') == 29, "U't' converts to 29");
-  static_assert(AsciiAlphanumericToNumber(U'u') == 30, "U'u' converts to 30");
-  static_assert(AsciiAlphanumericToNumber(U'v') == 31, "U'v' converts to 31");
-  static_assert(AsciiAlphanumericToNumber(U'w') == 32, "U'w' converts to 32");
-  static_assert(AsciiAlphanumericToNumber(U'x') == 33, "U'x' converts to 33");
-  static_assert(AsciiAlphanumericToNumber(U'y') == 34, "U'y' converts to 34");
-  static_assert(AsciiAlphanumericToNumber(U'z') == 35, "U'z' converts to 35");
-}
+static_assert(U'Z' == 0x5A, "U'Z' has value 0x5A");
+static_assert(U'[' == 0x5B, "U'[' has value 0x5B");
+static_assert(!IsAsciiAlpha(U'['), "U'[' isn't ASCII alpha");
 
-static void
-TestIsAsciiDigit()
-{
-  // char
-
-  static_assert(!IsAsciiDigit('/'), "'/' isn't an ASCII digit");
-  static_assert('/' == 0x2F, "'/' has value 0x2F");
-
-  static_assert('0' == 0x30, "'0' has value 0x30");
-  static_assert(IsAsciiDigit('0'), "'0' is an ASCII digit");
-  static_assert(IsAsciiDigit('1'), "'1' is an ASCII digit");
-  static_assert(IsAsciiDigit('5'), "'5' is an ASCII digit");
-  static_assert(IsAsciiDigit('8'), "'8' is an ASCII digit");
-  static_assert(IsAsciiDigit('9'), "'9' is an ASCII digit");
-
-  static_assert('9' == 0x39, "'9' has value 0x39");
-  static_assert(':' == 0x3A, "':' has value 0x3A");
-  static_assert(!IsAsciiDigit(':'), "':' isn't an ASCII digit");
-
-  static_assert(!IsAsciiDigit('@'), "'@' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit('A'), "'A' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit('B'), "'B' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit('M'), "'M' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit('Y'), "'Y' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit('Z'), "'Z' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit('['), "'[' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit('`'), "'`' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit('a'), "'a' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit('b'), "'b' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit('m'), "'m' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit('y'), "'y' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit('z'), "'z' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit('{'), "'{' isn't an ASCII digit");
-
-  // char16_t
-
-  static_assert(!IsAsciiDigit(u'/'), "u'/' isn't an ASCII digit");
-  static_assert(u'/' == 0x2F, "u'/' has value 0x2F");
-
-  static_assert(u'0' == 0x30, "u'0' has value 0x30");
-  static_assert(IsAsciiDigit(u'0'), "u'0' is an ASCII digit");
-  static_assert(IsAsciiDigit(u'1'), "u'1' is an ASCII digit");
-  static_assert(IsAsciiDigit(u'5'), "u'5' is an ASCII digit");
-  static_assert(IsAsciiDigit(u'8'), "u'8' is an ASCII digit");
-  static_assert(IsAsciiDigit(u'9'), "u'9' is an ASCII digit");
+static_assert(!IsAsciiAlpha(U'`'), "U'`' isn't ASCII alpha");
+static_assert(U'`' == 0x60, "U'`' has value 0x60");
 
-  static_assert(u'9' == 0x39, "u'9' has value 0x39");
-  static_assert(u':' == 0x3A, "u':' has value 0x3A");
-  static_assert(!IsAsciiDigit(u':'), "u':' isn't an ASCII digit");
-
-  static_assert(!IsAsciiDigit(u'@'), "u'@' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(u'A'), "u'A' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(u'B'), "u'B' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(u'M'), "u'M' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(u'Y'), "u'Y' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(u'Z'), "u'Z' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(u'['), "u'[' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(u'`'), "u'`' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(u'a'), "u'a' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(u'b'), "u'b' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(u'm'), "u'm' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(u'y'), "u'y' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(u'z'), "u'z' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(u'{'), "u'{' isn't an ASCII digit");
-
-  // char32_t
-
-  static_assert(!IsAsciiDigit(U'/'), "U'/' isn't an ASCII digit");
-  static_assert(U'/' == 0x2F, "U'/' has value 0x2F");
+static_assert(U'a' == 0x61, "U'a' has value 0x61");
+static_assert(IsAsciiAlpha(U'a'), "U'a' is ASCII alpha");
+static_assert(IsAsciiAlpha(U'b'), "U'b' is ASCII alpha");
+static_assert(IsAsciiAlpha(U'm'), "U'm' is ASCII alpha");
+static_assert(IsAsciiAlpha(U'y'), "U'y' is ASCII alpha");
+static_assert(IsAsciiAlpha(U'z'), "U'z' is ASCII alpha");
 
-  static_assert(U'0' == 0x30, "U'0' has value 0x30");
-  static_assert(IsAsciiDigit(U'0'), "U'0' is an ASCII digit");
-  static_assert(IsAsciiDigit(U'1'), "U'1' is an ASCII digit");
-  static_assert(IsAsciiDigit(U'5'), "U'5' is an ASCII digit");
-  static_assert(IsAsciiDigit(U'8'), "U'8' is an ASCII digit");
-  static_assert(IsAsciiDigit(U'9'), "U'9' is an ASCII digit");
-
-  static_assert(U'9' == 0x39, "U'9' has value 0x39");
-  static_assert(U':' == 0x3A, "U':' has value 0x3A");
-  static_assert(!IsAsciiDigit(U':'), "U':' isn't an ASCII digit");
-
-  static_assert(!IsAsciiDigit(U'@'), "U'@' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(U'A'), "U'A' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(U'B'), "U'B' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(U'M'), "U'M' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(U'Y'), "U'Y' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(U'Z'), "U'Z' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(U'['), "U'[' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(U'`'), "U'`' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(U'a'), "U'a' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(U'b'), "U'b' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(U'm'), "U'm' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(U'y'), "U'y' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(U'z'), "U'z' isn't an ASCII digit");
-  static_assert(!IsAsciiDigit(U'{'), "U'{' isn't an ASCII digit");
-}
+static_assert(U'z' == 0x7A, "U'z' has value 0x7A");
+static_assert(U'{' == 0x7B, "U'{' has value 0x7B");
+static_assert(!IsAsciiAlpha(U'{'), "U'{' isn't ASCII alpha");
 
 int
 main()
 {
-  TestIsAsciiAlpha();
-  TestIsAsciiUppercaseAlpha();
-  TestIsAsciiLowercaseAlpha();
-  TestIsAsciiAlphanumeric();
-  TestAsciiAlphanumericToNumber();
-  TestIsAsciiDigit();
+  return 0;
 }
--- a/netwerk/base/nsStandardURL.cpp
+++ b/netwerk/base/nsStandardURL.cpp
@@ -15,17 +15,16 @@
 #include "nsIObjectOutputStream.h"
 #include "nsIIDNService.h"
 #include "mozilla/Logging.h"
 #include "nsAutoPtr.h"
 #include "nsIURLParser.h"
 #include "nsNetCID.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/ipc/URIUtils.h"
-#include "mozilla/TextUtils.h"
 #include <algorithm>
 #include "nsContentUtils.h"
 #include "prprf.h"
 #include "nsReadableUtils.h"
 #include "mozilla/net/MozURL_ffi.h"
 
 
 //
@@ -909,17 +908,17 @@ nsStandardURL::BuildNormalizedSpec(const
 
     buf[i] = '\0';
 
     // https://url.spec.whatwg.org/#path-state (1.4.1.2)
     // https://url.spec.whatwg.org/#windows-drive-letter
     if (SegmentIs(buf, mScheme, "file")) {
         char* path = &buf[mPath.mPos];
         if (mPath.mLen >= 3 && path[0] == '/'
-            && IsAsciiAlpha(path[1])
+            && nsCRT::IsAsciiAlpha(path[1])
             && path[2] == '|') {
             buf[mPath.mPos + 2] = ':';
         }
     }
 
     if (mDirectory.mLen > 1) {
         netCoalesceFlags coalesceFlag = NET_COALESCE_NORMAL;
         if (SegmentIs(buf,mScheme,"ftp")) {
--- a/netwerk/base/nsURLHelper.cpp
+++ b/netwerk/base/nsURLHelper.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* vim:set ts=4 sw=4 sts=4 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/RangedPtr.h"
-#include "mozilla/TextUtils.h"
 
 #include <algorithm>
 #include <iterator>
 
 #include "nsASCIIMask.h"
 #include "nsURLHelper.h"
 #include "nsIFile.h"
 #include "nsIURLParser.h"
@@ -473,20 +472,24 @@ net_ResolveRelativePath(const nsACString
     result = path;
     return NS_OK;
 }
 
 //----------------------------------------------------------------------------
 // scheme fu
 //----------------------------------------------------------------------------
 
+static bool isAsciiAlpha(char c) {
+    return nsCRT::IsAsciiAlpha(c);
+}
+
 static bool
 net_IsValidSchemeChar(const char aChar)
 {
-    if (IsAsciiAlpha(aChar) || IsAsciiDigit(aChar) ||
+    if (nsCRT::IsAsciiAlpha(aChar) || nsCRT::IsAsciiDigit(aChar) ||
         aChar == '+' || aChar == '.' || aChar == '-') {
         return true;
     }
     return false;
 }
 
 /* Extract URI-Scheme if possible */
 nsresult
@@ -502,17 +505,17 @@ net_ExtractURLScheme(const nsACString &i
         if ((uint8_t) *start > 0x20) {
             break;
         }
         start++;
     }
 
     Tokenizer p(Substring(start, end), "\r\n\t");
     p.Record();
-    if (!p.CheckChar(IsAsciiAlpha)) {
+    if (!p.CheckChar(isAsciiAlpha)) {
         // First char must be alpha
         return NS_ERROR_MALFORMED_URI;
     }
 
     while (p.CheckChar(net_IsValidSchemeChar) || p.CheckWhite()) {
         // Skip valid scheme characters or \r\n\t
     }
 
@@ -525,23 +528,23 @@ net_ExtractURLScheme(const nsACString &i
     ToLowerCase(scheme);
     return NS_OK;
 }
 
 bool
 net_IsValidScheme(const char *scheme, uint32_t schemeLen)
 {
     // first char must be alpha
-    if (!IsAsciiAlpha(*scheme))
+    if (!nsCRT::IsAsciiAlpha(*scheme))
         return false;
 
     // nsCStrings may have embedded nulls -- reject those too
     for (; schemeLen; ++scheme, --schemeLen) {
-        if (!(IsAsciiAlpha(*scheme) ||
-              IsAsciiDigit(*scheme) ||
+        if (!(nsCRT::IsAsciiAlpha(*scheme) ||
+              nsCRT::IsAsciiDigit(*scheme) ||
               *scheme == '+' ||
               *scheme == '.' ||
               *scheme == '-'))
             return false;
     }
 
     return true;
 }
@@ -559,17 +562,17 @@ net_IsAbsoluteURL(const nsACString& uri)
             break;
         }
         start++;
     }
 
     Tokenizer p(Substring(start, end), "\r\n\t");
 
     // First char must be alpha
-    if (!p.CheckChar(IsAsciiAlpha)) {
+    if (!p.CheckChar(isAsciiAlpha)) {
         return false;
     }
 
     while (p.CheckChar(net_IsValidSchemeChar) || p.CheckWhite()) {
         // Skip valid scheme characters or \r\n\t
     }
     if (!p.CheckChar(':')) {
         return false;
--- a/netwerk/base/nsURLParsers.cpp
+++ b/netwerk/base/nsURLParsers.cpp
@@ -1,21 +1,21 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <string.h>
 
 #include "mozilla/RangedPtr.h"
-#include "mozilla/TextUtils.h"
 
 #include "nsURLParsers.h"
 #include "nsURLHelper.h"
 #include "nsString.h"
+#include "nsCRT.h"
 
 using namespace mozilla;
 
 //----------------------------------------------------------------------------
 
 static uint32_t
 CountConsecutiveSlashes(const char *str, int32_t len)
 {
@@ -382,17 +382,17 @@ nsNoAuthURLParser::ParseAfterScheme(cons
             if (specLen > 2) {
                 // looks like there is an authority section
 
                 // if the authority looks like a drive number then we
                 // really want to treat it as part of the path
                 // [a-zA-Z][:|]{/\}
                 // i.e one of:   c:   c:\foo  c:/foo  c|  c|\foo  c|/foo
                 if ((specLen > 3) && (spec[3] == ':' || spec[3] == '|') &&
-                    IsAsciiAlpha(spec[2]) &&
+                    nsCRT::IsAsciiAlpha(spec[2]) &&
                     ((specLen == 4) || (spec[4] == '/') || (spec[4] == '\\'))) {
                     pos = 1;
                     break;
                 }
                 // Ignore apparent authority; path is everything after it
                 for (p = spec + 2; p < spec + specLen; ++p) {
                     if (*p == '/' || *p == '?' || *p == '#')
                         break;
@@ -429,17 +429,17 @@ nsNoAuthURLParser::ParseFilePath(const c
 
     // look for a filepath consisting of only a drive number, which may or
     // may not have a leading slash.
     if (filepathLen > 1 && filepathLen < 4) {
         const char *end = filepath + filepathLen;
         const char *p = filepath;
         if (*p == '/')
             p++;
-        if ((end-p == 2) && (p[1]==':' || p[1]=='|') && IsAsciiAlpha(*p)) {
+        if ((end-p == 2) && (p[1]==':' || p[1]=='|') && nsCRT::IsAsciiAlpha(*p)) {
             // filepath = <drive-number>:
             SET_RESULT(directory, 0, filepathLen);
             SET_RESULT(basename, 0, -1);
             SET_RESULT(extension, 0, -1);
             return NS_OK;
         }
     }
 
--- a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
+++ b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
@@ -1,32 +1,28 @@
 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "mozilla/TextUtils.h"
 #include "mozTXTToHTMLConv.h"
 #include "nsNetUtil.h"
 #include "nsUnicharUtils.h"
 #include "nsCRT.h"
 #include "nsIExternalProtocolHandler.h"
 #include "nsIIOService.h"
 #include "nsIURI.h"
 
 #include <algorithm>
 
 #ifdef DEBUG_BenB_Perf
 #include "prtime.h"
 #include "prinrval.h"
 #endif
 
-using mozilla::IsAsciiAlpha;
-using mozilla::IsAsciiDigit;
-
 const double growthRate = 1.2;
 
 // Bug 183111, editor now replaces multiple spaces with leading
 // 0xA0's and a single ending space, so need to treat 0xA0's as spaces.
 // 0xA0 is the Latin1/Unicode character for "non-breaking space (nbsp)"
 // Also recognize the Japanese ideographic space 0x3000 as a space.
 static inline bool IsSpace(const char16_t aChar)
 {
@@ -218,24 +214,24 @@ mozTXTToHTMLConv::FindURLStart(const cha
     }
     else
       return false;
   }
   case freetext:
   {
     int32_t i = pos - 1;
     for (; i >= 0 && (
-         IsAsciiAlpha(aInString[uint32_t(i)]) ||
-         IsAsciiDigit(aInString[uint32_t(i)]) ||
+         nsCRT::IsAsciiAlpha(aInString[uint32_t(i)]) ||
+         nsCRT::IsAsciiDigit(aInString[uint32_t(i)]) ||
          aInString[uint32_t(i)] == '+' ||
          aInString[uint32_t(i)] == '-' ||
          aInString[uint32_t(i)] == '.'
          ); i--)
       ;
-    if (++i >= 0 && uint32_t(i) < pos && IsAsciiAlpha(aInString[uint32_t(i)]))
+    if (++i >= 0 && uint32_t(i) < pos && nsCRT::IsAsciiAlpha(aInString[uint32_t(i)]))
     {
       start = uint32_t(i);
       return true;
     }
     else
       return false;
   }
   case abbreviated:
@@ -256,18 +252,18 @@ mozTXTToHTMLConv::FindURLStart(const cha
              && (!isEmail || nsCRT::IsAscii(aInString[uint32_t(i)]))
          ; i--)
       ;
     if
       (
         ++i >= 0 && uint32_t(i) < pos
           &&
           (
-            IsAsciiAlpha(aInString[uint32_t(i)]) ||
-            IsAsciiDigit(aInString[uint32_t(i)])
+            nsCRT::IsAsciiAlpha(aInString[uint32_t(i)]) ||
+            nsCRT::IsAsciiDigit(aInString[uint32_t(i)])
           )
       )
     {
       start = uint32_t(i);
       return true;
     }
     else
       return false;
@@ -596,35 +592,35 @@ mozTXTToHTMLConv::ItMatchesDelimited(con
     return false;
 
   char16_t text0 = aInString[0];
   char16_t textAfterPos = aInString[aRepLen + (before == LT_IGNORE ? 0 : 1)];
 
   if
     (
       (before == LT_ALPHA
-        && !IsAsciiAlpha(text0)) ||
+        && !nsCRT::IsAsciiAlpha(text0)) ||
       (before == LT_DIGIT
-        && !IsAsciiDigit(text0)) ||
+        && !nsCRT::IsAsciiDigit(text0)) ||
       (before == LT_DELIMITER
         &&
         (
-          IsAsciiAlpha(text0) ||
-          IsAsciiDigit(text0) ||
+          nsCRT::IsAsciiAlpha(text0) ||
+          nsCRT::IsAsciiDigit(text0) ||
           text0 == *rep
         )) ||
       (after == LT_ALPHA
-        && !IsAsciiAlpha(textAfterPos)) ||
+        && !nsCRT::IsAsciiAlpha(textAfterPos)) ||
       (after == LT_DIGIT
-        && !IsAsciiDigit(textAfterPos)) ||
+        && !nsCRT::IsAsciiDigit(textAfterPos)) ||
       (after == LT_DELIMITER
         &&
         (
-          IsAsciiAlpha(textAfterPos) ||
-          IsAsciiDigit(textAfterPos) ||
+          nsCRT::IsAsciiAlpha(textAfterPos) ||
+          nsCRT::IsAsciiDigit(textAfterPos) ||
           textAfterPos == *rep
         )) ||
         !Substring(Substring(aInString, aInString+aInLength),
                    (before == LT_IGNORE ? 0 : 1),
                    aRepLen).Equals(Substring(rep, rep+aRepLen),
                                    nsCaseInsensitiveStringComparator())
     )
     return false;
@@ -943,39 +939,39 @@ mozTXTToHTMLConv::GlyphHit(const char16_
 
   // x^2  =>  x<sup>2</sup>,   also handle powers x^-2,  x^0.5
   // implement regular expression /[\dA-Za-z\)\]}]\^-?\d+(\.\d+)*[^\dA-Za-z]/
   if
     (
       text1 == '^'
       &&
       (
-        IsAsciiDigit(text0) || IsAsciiAlpha(text0) ||
+        nsCRT::IsAsciiDigit(text0) || nsCRT::IsAsciiAlpha(text0) ||
         text0 == ')' || text0 == ']' || text0 == '}'
       )
       &&
       (
-        (2 < aInLength && IsAsciiDigit(aInString[2])) ||
-        (3 < aInLength && aInString[2] == '-' && IsAsciiDigit(aInString[3]))
+        (2 < aInLength && nsCRT::IsAsciiDigit(aInString[2])) ||
+        (3 < aInLength && aInString[2] == '-' && nsCRT::IsAsciiDigit(aInString[3]))
       )
     )
   {
     // Find first non-digit
     int32_t delimPos = 3;  // skip "^" and first digit (or '-')
     for (; delimPos < aInLength
            &&
            (
-             IsAsciiDigit(aInString[delimPos]) ||
+             nsCRT::IsAsciiDigit(aInString[delimPos]) ||
              (aInString[delimPos] == '.' && delimPos + 1 < aInLength &&
-               IsAsciiDigit(aInString[delimPos + 1]))
+               nsCRT::IsAsciiDigit(aInString[delimPos + 1]))
            );
          delimPos++)
       ;
 
-    if (delimPos < aInLength && IsAsciiAlpha(aInString[delimPos]))
+    if (delimPos < aInLength && nsCRT::IsAsciiAlpha(aInString[delimPos]))
     {
       return false;
     }
 
     outputHTML.Truncate();
     outputHTML += text0;
     outputHTML.AppendLiteral(
       "<sup class=\"moz-txt-sup\">"
@@ -1047,17 +1043,17 @@ mozTXTToHTMLConv::CiteLevelTXT(const cha
 
        logLineStart is the position of "t" in this example
     */
     uint32_t i = logLineStart;
 
 #ifdef QUOTE_RECOGNITION_AGGRESSIVE
     for (; int32_t(i) < lineLength && IsSpace(line[i]); i++)
       ;
-    for (; int32_t(i) < lineLength && IsAsciiAlpha(line[i])
+    for (; int32_t(i) < lineLength && nsCRT::IsAsciiAlpha(line[i])
                                    && nsCRT::IsUpper(line[i])   ; i++)
       ;
     if (int32_t(i) < lineLength && (line[i] == '>' || line[i] == ']'))
 #else
     if (int32_t(i) < lineLength && line[i] == '>')
 #endif
     {
       i++;
--- a/xpcom/base/nsCRTGlue.h
+++ b/xpcom/base/nsCRTGlue.h
@@ -130,24 +130,37 @@ constexpr bool
 NS_ConstExprIsAscii(const char* aString, uint32_t aLength)
 {
   return aLength == 0 ? true :
     !NS_IsAscii(*aString) ? false :
     NS_ConstExprIsAscii(aString + 1, aLength - 1);
 }
 
 constexpr bool
+NS_IsAsciiAlpha(char16_t aChar)
+{
+  return (aChar >= 'A' && aChar <= 'Z') ||
+         (aChar >= 'a' && aChar <= 'z');
+}
+
+constexpr bool
 NS_IsAsciiWhitespace(char16_t aChar)
 {
   return aChar == ' ' ||
          aChar == '\r' ||
          aChar == '\n' ||
          aChar == '\t';
 }
 
+constexpr bool
+NS_IsAsciiDigit(char16_t aChar)
+{
+  return aChar >= '0' && aChar <= '9';
+}
+
 #ifndef XPCOM_GLUE_AVOID_NSPR
 void NS_MakeRandomString(char* aBuf, int32_t aBufLen);
 #endif
 
 #define FF '\f'
 #define TAB '\t'
 
 #define CRSTR "\015"
--- a/xpcom/ds/nsCRT.h
+++ b/xpcom/ds/nsCRT.h
@@ -91,16 +91,18 @@ public:
   static char ToUpper(char aChar) { return NS_ToUpper(aChar); }
   static char ToLower(char aChar) { return NS_ToLower(aChar); }
 
   static bool IsUpper(char aChar) { return NS_IsUpper(aChar); }
   static bool IsLower(char aChar) { return NS_IsLower(aChar); }
 
   static bool IsAscii(char16_t aChar) { return NS_IsAscii(aChar); }
   static bool IsAscii(const char16_t* aString) { return NS_IsAscii(aString); }
+  static bool IsAsciiAlpha(char16_t aChar) { return NS_IsAsciiAlpha(aChar); }
+  static bool IsAsciiDigit(char16_t aChar) { return NS_IsAsciiDigit(aChar); }
   static bool IsAsciiSpace(char16_t aChar) { return NS_IsAsciiWhitespace(aChar); }
   static bool IsAscii(const char* aString) { return NS_IsAscii(aString); }
   static bool IsAscii(const char* aString, uint32_t aLength)
   {
     return NS_IsAscii(aString, aLength);
   }
 };