Bug 1590907 - Make ENABLE_INTL_API and ENABLE_TYPED_OBJECTS into js-config macros. r=sfink,firefox-build-system-reviewers,mshal
☠☠ backed out by 98fd7a222745 ☠ ☠
authorPhilip Chimento <philip.chimento@gmail.com>
Tue, 26 Nov 2019 02:02:23 +0000
changeset 503782 1b5b40dcaac483ef5cc08416570e512995fd4dca
parent 503781 1b2d91f00be294ce71cb76736254de93b2416904
child 503783 fc85ee5e144c38005677d749ebbdf90384f9230c
push id36847
push userncsoregi@mozilla.com
push dateTue, 26 Nov 2019 09:34:48 +0000
treeherdermozilla-central@7bc0df30a8a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink, firefox-build-system-reviewers, mshal
bugs1590907
milestone72.0a1
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
Bug 1590907 - Make ENABLE_INTL_API and ENABLE_TYPED_OBJECTS into js-config macros. r=sfink,firefox-build-system-reviewers,mshal Whether ENABLE_INTL_API and ENABLE_TYPED_OBJECTS are defined, affects the behaviour of JS_FOR_PROTOTYPES for the prototypes of Intl and TypedObject. Therefore, these macros have to be available to embedders. Rename them to JS_HAS_INTL_API and JS_HAS_TYPED_OBJECTS (in line with the existing JS_HAS_CTYPES) everywhere they are used, and add them to js-config.h.in. Differential Revision: https://phabricator.services.mozilla.com/D52461
build/autoconf/icu.m4
js/moz.configure
js/public/LocaleSensitive.h
js/public/ProtoKey.h
js/src/build/moz.build
js/src/builtin/Array.js
js/src/builtin/BigInt.cpp
js/src/builtin/BigInt.h
js/src/builtin/BigInt.js
js/src/builtin/Date.js
js/src/builtin/Number.js
js/src/builtin/String.cpp
js/src/builtin/String.h
js/src/builtin/String.js
js/src/builtin/TestingFunctions.cpp
js/src/builtin/TypedArray.js
js/src/gc/RootMarking.cpp
js/src/jit/MCallOptimize.cpp
js/src/js-config.h.in
js/src/jsapi.cpp
js/src/jsdate.cpp
js/src/jsfriendapi.cpp
js/src/jsfriendapi.h
js/src/jsnum.cpp
js/src/jsnum.h
js/src/moz.build
js/src/shell/js.cpp
js/src/vm/DateTime.cpp
js/src/vm/DateTime.h
js/src/vm/GlobalObject.cpp
js/src/vm/Initialization.cpp
js/src/vm/Runtime.cpp
js/src/vm/Runtime.h
js/src/vm/SelfHosting.cpp
js/src/vm/Time.cpp
js/src/vm/Time.h
js/src/wasm/WasmModule.cpp
js/sub.configure
js/xpconnect/src/XPCLocale.cpp
--- a/build/autoconf/icu.m4
+++ b/build/autoconf/icu.m4
@@ -24,34 +24,34 @@ AC_SUBST(MOZ_SYSTEM_ICU)
 
 MOZ_ARG_WITH_STRING(intl-api,
 [  --with-intl-api, --without-intl-api
     Determine the status of the ECMAScript Internationalization API.  The first
     (or lack of any of these) builds and exposes the API.  The second doesn't
     build ICU at all.],
     _INTL_API=$withval)
 
-ENABLE_INTL_API=
+JS_HAS_INTL_API=
 case "$_INTL_API" in
 no)
     ;;
 yes)
-    ENABLE_INTL_API=1
+    JS_HAS_INTL_API=1
     ;;
 *)
     AC_MSG_ERROR([Invalid value passed to --with-intl-api: $_INTL_API])
     ;;
 esac
 
-if test -n "$ENABLE_INTL_API"; then
+if test -n "$JS_HAS_INTL_API"; then
     USE_ICU=1
 fi
 
-if test -n "$ENABLE_INTL_API"; then
-    AC_DEFINE(ENABLE_INTL_API)
+if test -n "$JS_HAS_INTL_API"; then
+    AC_DEFINE(JS_HAS_INTL_API)
 fi
 
 dnl Settings for the implementation of the ECMAScript Internationalization API
 if test -n "$USE_ICU"; then
     icudir="$_topsrcdir/intl/icu/source"
     if test ! -d "$icudir"; then
         icudir="$_topsrcdir/../../intl/icu/source"
         if test ! -d "$icudir"; then
@@ -67,17 +67,17 @@ if test -n "$USE_ICU"; then
 
     # TODO: the l is actually endian-dependent
     # We could make this set as 'l' or 'b' for little or big, respectively,
     # but we'd need to check in a big-endian version of the file.
     ICU_DATA_FILE="icudt${version}l.dat"
 fi
 
 AC_SUBST(MOZ_ICU_VERSION)
-AC_SUBST(ENABLE_INTL_API)
+AC_SUBST(JS_HAS_INTL_API)
 AC_SUBST(USE_ICU)
 AC_SUBST(ICU_DATA_FILE)
 
 if test -n "$USE_ICU"; then
     dnl Source files that use ICU should have control over which parts of the ICU
     dnl namespace they want to use.
     AC_DEFINE(U_USING_ICU_NAMESPACE,0)
 
--- a/js/moz.configure
+++ b/js/moz.configure
@@ -486,18 +486,18 @@ set_define('WASM_CODEGEN_DEBUG', depends
 @depends(milestone.is_nightly)
 def default_typed_objects(is_nightly):
     return is_nightly
 
 js_option('--enable-typed-objects',
           default=default_typed_objects,
           help='{Enable|Disable} typed objects')
 
-set_config('ENABLE_TYPED_OBJECTS', depends_if('--enable-typed-objects')(lambda x: True))
-set_define('ENABLE_TYPED_OBJECTS', depends_if('--enable-typed-objects')(lambda x: True))
+set_config('JS_HAS_TYPED_OBJECTS', depends_if('--enable-typed-objects')(lambda x: True))
+set_define('JS_HAS_TYPED_OBJECTS', depends_if('--enable-typed-objects')(lambda x: True))
 
 
 # Support for WebAssembly bulk memory operations.
 # =====================================================
 
 @depends(milestone.is_nightly)
 def default_wasm_bulk_memory(is_nightly):
     return is_nightly
--- a/js/public/LocaleSensitive.h
+++ b/js/public/LocaleSensitive.h
@@ -60,17 +60,17 @@ using JSLocaleCompare = bool (*)(JSConte
 using JSLocaleToUnicode = bool (*)(JSContext* cx, const char* src,
                                    JS::MutableHandle<JS::Value> rval);
 
 /**
  * A suite of locale-specific string conversion and error message callbacks
  * used to implement locale-sensitive behaviors (such as those performed by
  * the various toLocaleString and toLocale{Date,Time}String functions).
  *
- * If SpiderMonkey is compiled --with-intl-api, then #if ENABLE_INTL_API.  In
+ * If SpiderMonkey is compiled --with-intl-api, then #if JS_HAS_INTL_API.  In
  * this case, SpiderMonkey itself will implement ECMA-402-compliant behavior by
  * calling on ICU, and none of the fields in this struct will ever be used.
  * (You'll still be able to call the get/set-callbacks functions; they just
  * won't affect JavaScript semantics.)
  */
 struct JSLocaleCallbacks {
   JSLocaleToUpperCase localeToUpperCase;
   JSLocaleToLowerCase localeToLowerCase;
--- a/js/public/ProtoKey.h
+++ b/js/public/ProtoKey.h
@@ -29,23 +29,23 @@
  * JS_FOR_EACH_PROTOTYPE does.
  */
 
 #define CLASP(NAME) (&NAME##Class)
 #define OCLASP(NAME) (&NAME##Object::class_)
 #define TYPED_ARRAY_CLASP(TYPE) (&TypedArrayObject::classes[Scalar::TYPE])
 #define ERROR_CLASP(TYPE) (&ErrorObject::classes[TYPE])
 
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
 #  define IF_INTL(REAL, IMAGINARY) REAL
 #else
 #  define IF_INTL(REAL, IMAGINARY) IMAGINARY
 #endif
 
-#ifdef ENABLE_TYPED_OBJECTS
+#ifdef JS_HAS_TYPED_OBJECTS
 #  define IF_TYPEDOBJ(REAL, IMAGINARY) REAL
 #else
 #  define IF_TYPEDOBJ(REAL, IMAGINARY) IMAGINARY
 #endif
 
 #define JS_FOR_PROTOTYPES_(REAL, IMAGINARY, REAL_IF_INTL, REAL_IF_BDATA)      \
   IMAGINARY(Null, dummy)                                                      \
   REAL(Object, OCLASP(Plain))                                                 \
--- a/js/src/build/moz.build
+++ b/js/src/build/moz.build
@@ -34,17 +34,17 @@ if CONFIG['JS_SHARED_LIBRARY']:
                       flags=[CONFIG['JS_LIBRARY_NAME'].replace('-', '_')])
         SYMBOLS_FILE = '!symverscript'
 else:
     Library('js')
 
 FORCE_STATIC_LIB = True
 STATIC_LIBRARY_NAME = 'js_static'
 
-if CONFIG['ENABLE_INTL_API']:
+if CONFIG['JS_HAS_INTL_API']:
     USE_LIBS += [
         'icu',
     ]
 
 USE_LIBS += [
     'nspr',
     'zlib',
 ]
--- a/js/src/builtin/Array.js
+++ b/js/src/builtin/Array.js
@@ -849,17 +849,17 @@ function ArrayToLocaleString(locales, op
     // Step 5.
     var firstElement = array[0];
 
     // Steps 6-7.
     var R;
     if (firstElement === undefined || firstElement === null) {
         R = "";
     } else {
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
         R = ToString(callContentFunction(firstElement.toLocaleString, firstElement, locales, options));
 #else
         R = ToString(callContentFunction(firstElement.toLocaleString, firstElement));
 #endif
     }
 
     // Step 3 (reordered).
     // We don't (yet?) implement locale-dependent separators.
@@ -868,17 +868,17 @@ function ArrayToLocaleString(locales, op
     // Steps 8-9.
     for (var k = 1; k < len; k++) {
         // Step 9.b.
         var nextElement = array[k];
 
         // Steps 9.a, 9.c-e.
         R += separator;
         if (!(nextElement === undefined || nextElement === null)) {
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
             R += ToString(callContentFunction(nextElement.toLocaleString, nextElement, locales, options));
 #else
             R += ToString(callContentFunction(nextElement.toLocaleString, nextElement));
 #endif
         }
     }
 
     // Step 10.
--- a/js/src/builtin/BigInt.cpp
+++ b/js/src/builtin/BigInt.cpp
@@ -119,17 +119,17 @@ bool BigIntObject::toString_impl(JSConte
   return true;
 }
 
 bool BigIntObject::toString(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   return CallNonGenericMethod<IsBigInt, toString_impl>(cx, args);
 }
 
-#ifndef ENABLE_INTL_API
+#ifndef JS_HAS_INTL_API
 // BigInt proposal section 5.3.2. "This function is
 // implementation-dependent, and it is permissible, but not encouraged,
 // for it to return the same thing as toString."
 bool BigIntObject::toLocaleString_impl(JSContext* cx, const CallArgs& args) {
   HandleValue thisv = args.thisv();
   MOZ_ASSERT(IsBigInt(thisv));
   RootedBigInt bi(cx, thisv.isBigInt()
                           ? thisv.toBigInt()
@@ -142,17 +142,17 @@ bool BigIntObject::toLocaleString_impl(J
   args.rval().setString(str);
   return true;
 }
 
 bool BigIntObject::toLocaleString(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   return CallNonGenericMethod<IsBigInt, toLocaleString_impl>(cx, args);
 }
-#endif /* !ENABLE_INTL_API */
+#endif /* !JS_HAS_INTL_API */
 
 // BigInt proposal section 5.2.1. BigInt.asUintN ( bits, bigint )
 bool BigIntObject::asUintN(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
 
   // Step 1.
   uint64_t bits;
   if (!ToIndex(cx, args.get(0), &bits)) {
@@ -221,17 +221,17 @@ const JSClass BigIntObject::protoClass_ 
     &BigIntObject::classSpec_};
 
 const JSPropertySpec BigIntObject::properties[] = {
     // BigInt proposal section 5.3.5
     JS_STRING_SYM_PS(toStringTag, "BigInt", JSPROP_READONLY), JS_PS_END};
 
 const JSFunctionSpec BigIntObject::methods[] = {
     JS_FN("valueOf", valueOf, 0, 0), JS_FN("toString", toString, 0, 0),
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
     JS_SELF_HOSTED_FN("toLocaleString", "BigInt_toLocaleString", 0, 0),
 #else
     JS_FN("toLocaleString", toLocaleString, 0, 0),
 #endif
     JS_FS_END};
 
 const JSFunctionSpec BigIntObject::staticMethods[] = {
     JS_FN("asUintN", asUintN, 2, 0), JS_FN("asIntN", asIntN, 2, 0), JS_FS_END};
--- a/js/src/builtin/BigInt.h
+++ b/js/src/builtin/BigInt.h
@@ -27,17 +27,17 @@ class BigIntObject : public NativeObject
 
   static JSObject* create(JSContext* cx, JS::Handle<JS::BigInt*> bi);
 
   // Methods defined on BigInt.prototype.
   static bool valueOf_impl(JSContext* cx, const CallArgs& args);
   static bool valueOf(JSContext* cx, unsigned argc, JS::Value* vp);
   static bool toString_impl(JSContext* cx, const CallArgs& args);
   static bool toString(JSContext* cx, unsigned argc, JS::Value* vp);
-#ifndef ENABLE_INTL_API
+#ifndef JS_HAS_INTL_API
   static bool toLocaleString_impl(JSContext* cx, const CallArgs& args);
   static bool toLocaleString(JSContext* cx, unsigned argc, JS::Value* vp);
 #endif
   static bool asUintN(JSContext* cx, unsigned argc, JS::Value* vp);
   static bool asIntN(JSContext* cx, unsigned argc, JS::Value* vp);
 
   JS::BigInt* unbox() const;
 
--- a/js/src/builtin/BigInt.js
+++ b/js/src/builtin/BigInt.js
@@ -1,13 +1,13 @@
 /* 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/. */
 
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
 /**
  * Format this BigInt object into a string, using the locale and formatting
  * options provided.
  *
  * Spec PR: https://github.com/tc39/ecma402/pull/236
  */
 function BigInt_toLocaleString() {
     // Step 1. Note that valueOf enforces "thisBigIntValue" restrictions.
@@ -28,9 +28,9 @@ function BigInt_toLocaleString() {
         numberFormat = numberFormatCache.numberFormat;
     } else {
         numberFormat = intl_NumberFormat(locales, options);
     }
 
     // Step 3.
     return intl_FormatNumber(numberFormat, x, /* formatToParts = */ false);
 }
-#endif  // ENABLE_INTL_API
+#endif  // JS_HAS_INTL_API
--- a/js/src/builtin/Date.js
+++ b/js/src/builtin/Date.js
@@ -1,13 +1,13 @@
 /* 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/. */
 
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
 // This cache, once primed, has these properties:
 //
 //   runtimeDefaultLocale:
 //     Locale information provided by the embedding, guiding SpiderMonkey's
 //     selection of a default locale.  See RuntimeDefaultLocale(), whose
 //     value controls the value returned by DefaultLocale() that's what's
 //     *actually* used.
 //   icuDefaultTimeZone:
@@ -162,9 +162,9 @@ function Date_toLocaleTimeString() {
     } else {
         options = ToDateTimeOptions(options, "time", "time");
         dateTimeFormat = intl_DateTimeFormat(locales, options);
     }
 
     // Step 7.
     return intl_FormatDateTime(dateTimeFormat, x, /* formatToParts = */ false);
 }
-#endif  // ENABLE_INTL_API
+#endif  // JS_HAS_INTL_API
--- a/js/src/builtin/Number.js
+++ b/js/src/builtin/Number.js
@@ -1,13 +1,13 @@
 /* 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/. */
 
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
 var numberFormatCache = new Record();
 
 /**
  * Format this Number object into a string, using the locale and formatting options
  * provided.
  *
  * Spec: ECMAScript Language Specification, 5.1 edition, 15.7.4.3.
  * Spec: ECMAScript Internationalization API Specification, 13.2.1.
@@ -32,17 +32,17 @@ function Number_toLocaleString() {
         numberFormat = numberFormatCache.numberFormat;
     } else {
         numberFormat = intl_NumberFormat(locales, options);
     }
 
     // Step 5.
     return intl_FormatNumber(numberFormat, x, /* formatToParts = */ false);
 }
-#endif  // ENABLE_INTL_API
+#endif  // JS_HAS_INTL_API
 
 // ES6 draft ES6 20.1.2.4
 function Number_isFinite(num) {
     if (typeof num !== "number")
         return false;
     return num - num === 0;
 }
 
--- a/js/src/builtin/String.cpp
+++ b/js/src/builtin/String.cpp
@@ -22,29 +22,29 @@
 #include <type_traits>
 
 #include "jsapi.h"
 #include "jsnum.h"
 #include "jstypes.h"
 
 #include "builtin/Array.h"
 #include "builtin/Boolean.h"
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
 #  include "builtin/intl/CommonFunctions.h"
 #endif
 #include "builtin/RegExp.h"
 #include "jit/InlinableNatives.h"
 #include "js/Conversions.h"
-#if !ENABLE_INTL_API
+#if !JS_HAS_INTL_API
 #  include "js/LocaleSensitive.h"
 #endif
 #include "js/PropertySpec.h"
 #include "js/StableStringChars.h"
 #include "js/UniquePtr.h"
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
 #  include "unicode/uchar.h"
 #  include "unicode/unorm2.h"
 #  include "unicode/ustring.h"
 #  include "unicode/utypes.h"
 #endif
 #include "util/StringBuffer.h"
 #include "util/Unicode.h"
 #include "vm/BytecodeUtil.h"
@@ -618,17 +618,17 @@ JSString* js::SubstringKernel(JSContext*
  */
 static char16_t Final_Sigma(const char16_t* chars, size_t length,
                             size_t index) {
   MOZ_ASSERT(index < length);
   MOZ_ASSERT(chars[index] == unicode::GREEK_CAPITAL_LETTER_SIGMA);
   MOZ_ASSERT(unicode::ToLowerCase(unicode::GREEK_CAPITAL_LETTER_SIGMA) ==
              unicode::GREEK_SMALL_LETTER_SIGMA);
 
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
   // Tell the analysis the BinaryProperty.contains function pointer called by
   // u_hasBinaryProperty cannot GC.
   JS::AutoSuppressGCAnalysis nogc;
 
   bool precededByCased = false;
   for (size_t i = index; i > 0;) {
     char16_t c = chars[--i];
     uint32_t codePoint = c;
@@ -884,17 +884,17 @@ bool js::str_toLowerCase(JSContext* cx, 
   if (!result) {
     return false;
   }
 
   args.rval().setString(result);
   return true;
 }
 
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
 // String.prototype.toLocaleLowerCase is self-hosted when Intl is exposed,
 // with core functionality performed by the intrinsic below.
 
 static const char* CaseMappingLocale(JSContext* cx, JSString* str) {
   JSLinearString* locale = str->ensureLinear(cx);
   if (!locale) {
     return nullptr;
   }
@@ -1017,17 +1017,17 @@ static bool str_toLocaleLowerCase(JSCont
   if (!result) {
     return false;
   }
 
   args.rval().setString(result);
   return true;
 }
 
-#endif  // ENABLE_INTL_API
+#endif  // JS_HAS_INTL_API
 
 static inline bool ToUpperCaseHasSpecialCasing(Latin1Char charCode) {
   // U+00DF LATIN SMALL LETTER SHARP S is the only Latin-1 code point with
   // special casing rules, so detect it inline.
   bool hasUpperCaseSpecialCasing =
       charCode == unicode::LATIN_SMALL_LETTER_SHARP_S;
   MOZ_ASSERT(hasUpperCaseSpecialCasing ==
              unicode::ChangesWhenUpperCasedSpecialCasing(charCode));
@@ -1326,17 +1326,17 @@ bool js::str_toUpperCase(JSContext* cx, 
   if (!result) {
     return false;
   }
 
   args.rval().setString(result);
   return true;
 }
 
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
 // String.prototype.toLocaleUpperCase is self-hosted when Intl is exposed,
 // with core functionality performed by the intrinsic below.
 
 bool js::intl_toLocaleUpperCase(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   MOZ_ASSERT(args.length() == 2);
   MOZ_ASSERT(args[0].isString());
   MOZ_ASSERT(args[1].isString());
@@ -1433,19 +1433,19 @@ static bool str_toLocaleUpperCase(JSCont
   if (!result) {
     return false;
   }
 
   args.rval().setString(result);
   return true;
 }
 
-#endif  // ENABLE_INTL_API
-
-#if ENABLE_INTL_API
+#endif  // JS_HAS_INTL_API
+
+#if JS_HAS_INTL_API
 
 // String.prototype.localeCompare is self-hosted when Intl functionality is
 // exposed, and the only intrinsics it requires are provided in the
 // implementation of Intl.Collator.
 
 #else
 
 // String.prototype.localeCompare is implemented in C++ (delegating to
@@ -1478,19 +1478,19 @@ static bool str_localeCompare(JSContext*
   if (!CompareStrings(cx, str, thatStr, &result)) {
     return false;
   }
 
   args.rval().setInt32(result);
   return true;
 }
 
-#endif  // ENABLE_INTL_API
-
-#if ENABLE_INTL_API
+#endif  // JS_HAS_INTL_API
+
+#if JS_HAS_INTL_API
 
 // ES2017 draft rev 45e890512fd77add72cc0ee742785f9f6f6482de
 // 21.1.3.12 String.prototype.normalize ( [ form ] )
 //
 // String.prototype.normalize is only implementable if ICU's normalization
 // functionality is available.
 static bool str_normalize(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
@@ -1616,17 +1616,17 @@ static bool str_normalize(JSContext* cx,
     return false;
   }
 
   // Step 7.
   args.rval().setString(ns);
   return true;
 }
 
-#endif  // ENABLE_INTL_API
+#endif  // JS_HAS_INTL_API
 
 static bool str_charAt(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
 
   RootedString str(cx);
   size_t i;
   if (args.thisv().isString() && args.length() != 0 && args[0].isInt32()) {
     str = args.thisv().toString();
@@ -3627,27 +3627,27 @@ static const JSFunctionSpec string_metho
     JS_SELF_HOSTED_FN("padEnd", "String_pad_end", 2, 0),
     JS_SELF_HOSTED_FN("codePointAt", "String_codePointAt", 1, 0),
     JS_FN("includes", str_includes, 1, 0), JS_FN("indexOf", str_indexOf, 1, 0),
     JS_FN("lastIndexOf", str_lastIndexOf, 1, 0),
     JS_FN("startsWith", str_startsWith, 1, 0),
     JS_FN("endsWith", str_endsWith, 1, 0), JS_FN("trim", str_trim, 0, 0),
     JS_FN("trimStart", str_trimStart, 0, 0),
     JS_FN("trimEnd", str_trimEnd, 0, 0),
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
     JS_SELF_HOSTED_FN("toLocaleLowerCase", "String_toLocaleLowerCase", 0, 0),
     JS_SELF_HOSTED_FN("toLocaleUpperCase", "String_toLocaleUpperCase", 0, 0),
     JS_SELF_HOSTED_FN("localeCompare", "String_localeCompare", 1, 0),
 #else
     JS_FN("toLocaleLowerCase", str_toLocaleLowerCase, 0, 0),
     JS_FN("toLocaleUpperCase", str_toLocaleUpperCase, 0, 0),
     JS_FN("localeCompare", str_localeCompare, 1, 0),
 #endif
     JS_SELF_HOSTED_FN("repeat", "String_repeat", 1, 0),
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
     JS_FN("normalize", str_normalize, 0, 0),
 #endif
 
     /* Perl-ish methods (search is actually Python-esque). */
     JS_SELF_HOSTED_FN("match", "String_match", 1, 0),
     JS_SELF_HOSTED_FN("matchAll", "String_matchAll", 1, 0),
     JS_SELF_HOSTED_FN("search", "String_search", 1, 0),
     JS_SELF_HOSTED_FN("replace", "String_replace", 2, 0),
--- a/js/src/builtin/String.h
+++ b/js/src/builtin/String.h
@@ -51,17 +51,17 @@ extern bool str_toString(JSContext* cx, 
 
 extern bool str_charCodeAt_impl(JSContext* cx, HandleString string,
                                 HandleValue index, MutableHandleValue res);
 
 extern bool str_charCodeAt(JSContext* cx, unsigned argc, Value* vp);
 
 extern bool str_endsWith(JSContext* cx, unsigned argc, Value* vp);
 
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
 /**
  * Returns the input string converted to lower case based on the language
  * specific case mappings for the input locale.
  *
  * Usage: lowerCase = intl_toLocaleLowerCase(string, locale)
  */
 extern MOZ_MUST_USE bool intl_toLocaleLowerCase(JSContext* cx, unsigned argc,
                                                 Value* vp);
--- a/js/src/builtin/String.js
+++ b/js/src/builtin/String.js
@@ -668,17 +668,17 @@ function StringIteratorNext() {
     UnsafeSetReservedSlot(obj, ITERATOR_SLOT_NEXT_INDEX, index + charCount);
 
     // Communicate |first|'s possible range to the compiler.
     result.value = callFunction(std_String_fromCodePoint, null, first & 0x1fffff);
 
     return result;
 }
 
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
 var collatorCache = new Record();
 
 /**
  * Compare this String against that String, using the locale and collation
  * options provided.
  *
  * Spec: ECMAScript Internationalization API Specification, 13.1.1.
  */
@@ -786,17 +786,17 @@ function String_toLocaleUpperCase() {
         return "";
 
     if (requestedLocale === undefined)
         requestedLocale = DefaultLocale();
 
     // Steps 7-16.
     return intl_toLocaleUpperCase(string, requestedLocale);
 }
-#endif  // ENABLE_INTL_API
+#endif  // JS_HAS_INTL_API
 
 // ES2018 draft rev 8fadde42cf6a9879b4ab0cb6142b31c4ee501667
 // 21.1.2.4 String.raw ( template, ...substitutions )
 function String_static_raw(callSite/*, ...substitutions*/) {
     // Steps 1-2 (not applicable).
 
     // Step 3.
     var cooked = ToObject(callSite);
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -381,26 +381,26 @@ static bool GetBuildConfiguration(JSCont
   value = BooleanValue(true);
 #else
   value = BooleanValue(false);
 #endif
   if (!JS_SetProperty(cx, info, "valgrind", value)) {
     return false;
   }
 
-#ifdef ENABLE_TYPED_OBJECTS
+#ifdef JS_HAS_TYPED_OBJECTS
   value = BooleanValue(true);
 #else
   value = BooleanValue(false);
 #endif
   if (!JS_SetProperty(cx, info, "typed-objects", value)) {
     return false;
   }
 
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
   value = BooleanValue(true);
 #else
   value = BooleanValue(false);
 #endif
   if (!JS_SetProperty(cx, info, "intl-api", value)) {
     return false;
   }
 
--- a/js/src/builtin/TypedArray.js
+++ b/js/src/builtin/TypedArray.js
@@ -1238,17 +1238,17 @@ function TypedArrayToLocaleString(locale
         return "";
 
     // Step 5.
     var firstElement = array[0];
 
     // Steps 6-7.
     // Omit the 'if' clause in step 6, since typed arrays can't have undefined
     // or null elements.
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
     var R = ToString(callContentFunction(firstElement.toLocaleString, firstElement, locales, options));
 #else
     var R = ToString(callContentFunction(firstElement.toLocaleString, firstElement));
 #endif
 
     // Step 3 (reordered).
     // We don't (yet?) implement locale-dependent separators.
     var separator = ",";
@@ -1264,17 +1264,17 @@ function TypedArrayToLocaleString(locale
         // Step 9.c *should* be unreachable: typed array elements are numbers.
         // But bug 1079853 means |nextElement| *could* be |undefined|, if the
         // previous iteration's step 9.d or step 7 detached |array|'s buffer.
         // Conveniently, if this happens, evaluating |nextElement.toLocaleString|
         // throws the required TypeError, and the only observable difference is
         // the error message. So despite bug 1079853, we can skip step 9.c.
 
         // Step 9.d.
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
         R = ToString(callContentFunction(nextElement.toLocaleString, nextElement, locales, options));
 #else
         R = ToString(callContentFunction(nextElement.toLocaleString, nextElement));
 #endif
 
         // Step 9.e.
         R = S + R;
     }
--- a/js/src/gc/RootMarking.cpp
+++ b/js/src/gc/RootMarking.cpp
@@ -379,17 +379,17 @@ void js::gc::GCRuntime::traceRuntimeComm
   }
 
   // Trace runtime global roots.
   TracePersistentRooted(rt, trc);
 
   // Trace the self-hosting global compartment.
   rt->traceSelfHostingGlobal(trc);
 
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
   // Trace the shared Intl data.
   rt->traceSharedIntlData(trc);
 #endif
 
   // Trace the JSContext.
   rt->mainContextFromOwnThread()->trace(trc);
 
   // Trace all realm roots, but not the realm itself; it is traced via the
--- a/js/src/jit/MCallOptimize.cpp
+++ b/js/src/jit/MCallOptimize.cpp
@@ -4,17 +4,17 @@
  * 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/Casting.h"
 
 #include "jsmath.h"
 
 #include "builtin/AtomicsObject.h"
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
 #  include "builtin/intl/Collator.h"
 #  include "builtin/intl/DateTimeFormat.h"
 #  include "builtin/intl/ListFormat.h"
 #  include "builtin/intl/NumberFormat.h"
 #  include "builtin/intl/PluralRules.h"
 #  include "builtin/intl/RelativeTimeFormat.h"
 #endif
 #include "builtin/MapObject.h"
@@ -309,17 +309,17 @@ IonBuilder::InliningResult IonBuilder::i
       return inlineAtomicsBinop(callInfo, inlNative);
     case InlinableNative::AtomicsIsLockFree:
       return inlineAtomicsIsLockFree(callInfo);
 
     // Boolean natives.
     case InlinableNative::Boolean:
       return inlineBoolean(callInfo);
 
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
     // Intl natives.
     case InlinableNative::IntlGuardToCollator:
       return inlineGuardToClass(callInfo, &CollatorObject::class_);
     case InlinableNative::IntlGuardToDateTimeFormat:
       return inlineGuardToClass(callInfo, &DateTimeFormatObject::class_);
     case InlinableNative::IntlGuardToListFormat:
       return inlineGuardToClass(callInfo, &ListFormatObject::class_);
     case InlinableNative::IntlGuardToNumberFormat:
--- a/js/src/js-config.h.in
+++ b/js/src/js-config.h.in
@@ -30,16 +30,22 @@
 #endif
 
 /* Define to 1 if SpiderMonkey should include ctypes support.  */
 #undef JS_HAS_CTYPES
 
 /* Define to 1 if SpiderMonkey should include trace logging support. */
 #undef JS_TRACE_LOGGING
 
+/* Define to 1 if SpiderMonkey should include typed objects support. */
+#undef JS_HAS_TYPED_OBJECTS
+
+/* Define to 1 if SpiderMonkey should include support for the Intl API. */
+#undef JS_HAS_INTL_API
+
 /* Define to 1 if SpiderMonkey should include a breakpoint function for
  * artificial OOMs. */
 #undef JS_OOM_BREAKPOINT
 
 /* Define to 1 if SpiderMonkey should support the ability to perform
    entirely too much GC.  */
 #undef JS_GC_ZEAL
 
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -34,17 +34,17 @@
 #include "builtin/Boolean.h"
 #include "builtin/Eval.h"
 #include "builtin/FinalizationGroupObject.h"
 #include "builtin/JSON.h"
 #include "builtin/MapObject.h"
 #include "builtin/Promise.h"
 #include "builtin/Stream.h"
 #include "builtin/Symbol.h"
-#ifdef ENABLE_TYPED_OBJECTS
+#ifdef JS_HAS_TYPED_OBJECTS
 #  include "builtin/TypedObject.h"
 #endif
 #include "frontend/BytecodeCompiler.h"
 #include "gc/FreeOp.h"
 #include "gc/Marking.h"
 #include "gc/Policy.h"
 #include "gc/PublicIterators.h"
 #include "gc/WeakMap.h"
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -126,32 +126,32 @@ static Atomic<JS::ReduceMicrosecondTimeP
  *     equals
  *     hashCode
  */
 
 namespace {
 
 class DateTimeHelper {
  private:
-#if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
+#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
   static double localTZA(double t, DateTimeInfo::TimeZoneOffset offset);
 #else
   static int equivalentYearForDST(int year);
   static bool isRepresentableAsTime32(double t);
   static double daylightSavingTA(double t);
   static double adjustTime(double date);
   static PRMJTime toPRMJTime(double localTime, double utcTime);
 #endif
 
  public:
   static double localTime(double t);
   static double UTC(double t);
   static JSString* timeZoneComment(JSContext* cx, double utcTime,
                                    double localTime);
-#if !ENABLE_INTL_API || MOZ_SYSTEM_ICU
+#if !JS_HAS_INTL_API || MOZ_SYSTEM_ICU
   static size_t formatTime(char* buf, size_t buflen, const char* fmt,
                            double utcTime, double localTime);
 #endif
 };
 
 }  // namespace
 
 // ES2019 draft rev 0ceb728a1adbffe42b26972a6541fd7f398b1557
@@ -436,17 +436,17 @@ JS_PUBLIC_API void JS::SetReduceMicrosec
   sReduceMicrosecondTimePrecisionCallback = callback;
 }
 
 JS_PUBLIC_API void JS::SetTimeResolutionUsec(uint32_t resolution, bool jitter) {
   sResolutionUsec = resolution;
   sJitter = jitter;
 }
 
-#if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
+#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
 // ES2019 draft rev 0ceb728a1adbffe42b26972a6541fd7f398b1557
 // 20.3.1.7 LocalTZA ( t, isUTC )
 double DateTimeHelper::localTZA(double t, DateTimeInfo::TimeZoneOffset offset) {
   MOZ_ASSERT(IsFinite(t));
 
   int64_t milliseconds = static_cast<int64_t>(t);
   int32_t offsetMilliseconds =
       DateTimeInfo::getOffsetMilliseconds(milliseconds, offset);
@@ -558,17 +558,17 @@ double DateTimeHelper::UTC(double t) {
   // transitions. For example when transitioning from PST to PDT,
   // |new Date(2016,2,13,2,0,0).toTimeString()| returns the string value
   // "01:00:00 GMT-0800 (PST)" instead of "03:00:00 GMT-0700 (PDT)". Follow
   // V8 and subtract one hour before computing the offset.
   // Spec bug: https://bugs.ecmascript.org/show_bug.cgi?id=4007
 
   return t - adjustTime(t - DateTimeInfo::localTZA() - msPerHour);
 }
-#endif /* ENABLE_INTL_API && !MOZ_SYSTEM_ICU */
+#endif /* JS_HAS_INTL_API && !MOZ_SYSTEM_ICU */
 
 static double LocalTime(double t) { return DateTimeHelper::localTime(t); }
 
 static double UTC(double t) { return DateTimeHelper::UTC(t); }
 
 /* ES5 15.9.1.10. */
 static double HourFromTime(double t) {
   return PositiveModulo(floor(t / msPerHour), HoursPerDay);
@@ -2682,17 +2682,17 @@ static bool date_toJSON(JSContext* cx, u
                               JSMSG_BAD_TOISOSTRING_PROP);
     return false;
   }
 
   /* Step 6. */
   return Call(cx, toISO, obj, args.rval());
 }
 
-#if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
+#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
 JSString* DateTimeHelper::timeZoneComment(JSContext* cx, double utcTime,
                                           double localTime) {
   const char* locale = cx->runtime()->getDefaultLocale();
   if (!locale) {
     JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                               JSMSG_DEFAULT_LOCALE_ERROR);
     return nullptr;
   }
@@ -2788,17 +2788,17 @@ JSString* DateTimeHelper::timeZoneCommen
 
     if (usetz) {
       return NewStringCopyN<CanGC>(cx, tzbuf, tzlen);
     }
   }
 
   return cx->names().empty;
 }
-#endif /* ENABLE_INTL_API && !MOZ_SYSTEM_ICU */
+#endif /* JS_HAS_INTL_API && !MOZ_SYSTEM_ICU */
 
 static JSString* TimeZoneComment(JSContext* cx, double utcTime,
                                  double localTime) {
   return DateTimeHelper::timeZoneComment(cx, utcTime, localTime);
 }
 
 enum class FormatSpec { DateTime, Date, Time };
 
@@ -2882,17 +2882,17 @@ static bool FormatDate(JSContext* cx, do
       return false;
     }
   }
 
   rval.setString(str);
   return true;
 }
 
-#if !ENABLE_INTL_API
+#if !JS_HAS_INTL_API
 static bool ToLocaleFormatHelper(JSContext* cx, HandleObject obj,
                                  const char* format, MutableHandleValue rval) {
   double utcTime = obj->as<DateObject>().UTCTime().toNumber();
 
   char buf[100];
   if (!IsFinite(utcTime)) {
     strcpy(buf, js_InvalidDate_str);
   } else {
@@ -2990,17 +2990,17 @@ MOZ_ALWAYS_INLINE bool date_toLocaleTime
   Rooted<DateObject*> dateObj(cx, &args.thisv().toObject().as<DateObject>());
   return ToLocaleFormatHelper(cx, dateObj, "%X", args.rval());
 }
 
 static bool date_toLocaleTimeString(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   return CallNonGenericMethod<IsDate, date_toLocaleTimeString_impl>(cx, args);
 }
-#endif /* !ENABLE_INTL_API */
+#endif /* !JS_HAS_INTL_API */
 
 /* ES5 15.9.5.4. */
 MOZ_ALWAYS_INLINE bool date_toTimeString_impl(JSContext* cx,
                                               const CallArgs& args) {
   return FormatDate(
       cx, args.thisv().toObject().as<DateObject>().UTCTime().toNumber(),
       FormatSpec::Time, args.rval());
 }
@@ -3129,17 +3129,17 @@ static const JSFunctionSpec date_methods
     JS_FN("setUTCHours", date_setUTCHours, 4, 0),
     JS_FN("setMinutes", date_setMinutes, 3, 0),
     JS_FN("setUTCMinutes", date_setUTCMinutes, 3, 0),
     JS_FN("setSeconds", date_setSeconds, 2, 0),
     JS_FN("setUTCSeconds", date_setUTCSeconds, 2, 0),
     JS_FN("setMilliseconds", date_setMilliseconds, 1, 0),
     JS_FN("setUTCMilliseconds", date_setUTCMilliseconds, 1, 0),
     JS_FN("toUTCString", date_toGMTString, 0, 0),
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
     JS_SELF_HOSTED_FN(js_toLocaleString_str, "Date_toLocaleString", 0, 0),
     JS_SELF_HOSTED_FN("toLocaleDateString", "Date_toLocaleDateString", 0, 0),
     JS_SELF_HOSTED_FN("toLocaleTimeString", "Date_toLocaleTimeString", 0, 0),
 #else
     JS_FN(js_toLocaleString_str, date_toLocaleString, 0, 0),
     JS_FN("toLocaleDateString", date_toLocaleDateString, 0, 0),
     JS_FN("toLocaleTimeString", date_toLocaleTimeString, 0, 0),
 #endif
--- a/js/src/jsfriendapi.cpp
+++ b/js/src/jsfriendapi.cpp
@@ -1447,17 +1447,17 @@ JS_FRIEND_API bool js::RuntimeIsBeingDes
   JSRuntime* runtime = TlsContext.get()->runtime();
   MOZ_ASSERT(js::CurrentThreadCanAccessRuntime(runtime));
   return runtime->isBeingDestroyed();
 }
 #endif
 
 // No-op implementations of public API that would depend on --with-intl-api
 
-#ifndef ENABLE_INTL_API
+#ifndef JS_HAS_INTL_API
 
 static bool IntlNotEnabled(JSContext* cx) {
   JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, JSMSG_SUPPORT_NOT_ENABLED,
                             "Intl");
   return false;
 }
 
 bool js::AddMozDateTimeFormatConstructor(JSContext* cx, JS::HandleObject intl) {
@@ -1467,9 +1467,9 @@ bool js::AddMozDateTimeFormatConstructor
 bool js::AddListFormatConstructor(JSContext* cx, JS::HandleObject intl) {
   return IntlNotEnabled(cx);
 }
 
 bool js::AddLocaleConstructor(JSContext* cx, JS::HandleObject intl) {
   return IntlNotEnabled(cx);
 }
 
-#endif  // !ENABLE_INTL_API
+#endif  // !JS_HAS_INTL_API
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -2590,39 +2590,39 @@ MOZ_ALWAYS_INLINE JSObject* ToWindowProx
  * If `obj` is a WindowProxy, get its associated Window (the compartment's
  * global), else return `obj`. This function is infallible and never returns
  * nullptr.
  */
 extern JS_FRIEND_API JSObject* ToWindowIfWindowProxy(JSObject* obj);
 
 // Create and add the Intl.MozDateTimeFormat constructor function to the
 // provided object.
-// If JS was built without ENABLE_INTL_API, this function will throw an
+// If JS was built without JS_HAS_INTL_API, this function will throw an
 // exception.
 //
 // This custom date/time formatter constructor gives users the ability
 // to specify a custom format pattern. This pattern is passed *directly*
 // to ICU with NO SYNTAX PARSING OR VALIDATION WHATSOEVER. ICU appears to
 // have a a modicum of testing of this, and it won't fall over completely
 // if passed bad input. But the current behavior is entirely under-specified
 // and emphatically not shippable on the web, and it *must* be fixed before
 // this functionality can be exposed in the real world. (There are also some
 // questions about whether the format exposed here is the *right* one to
 // standardize, that will also need to be resolved to ship this.)
 extern bool AddMozDateTimeFormatConstructor(JSContext* cx,
                                             JS::Handle<JSObject*> intl);
 
 // Create and add the Intl.Locale constructor function to the provided object.
-// If JS was built without ENABLE_INTL_API, this function will throw an
+// If JS was built without JS_HAS_INTL_API, this function will throw an
 // exception.
 extern bool AddLocaleConstructor(JSContext* cx, JS::Handle<JSObject*> intl);
 
 // Create and add the Intl.ListFormat constructor function to the provided
 // object.
-// If JS was built without ENABLE_INTL_API, this function will throw an
+// If JS was built without JS_HAS_INTL_API, this function will throw an
 // exception.
 extern bool AddListFormatConstructor(JSContext* cx, JS::Handle<JSObject*> intl);
 
 class MOZ_STACK_CLASS JS_FRIEND_API AutoAssertNoContentJS {
  public:
   explicit AutoAssertNoContentJS(JSContext* cx);
   ~AutoAssertNoContentJS();
 
--- a/js/src/jsnum.cpp
+++ b/js/src/jsnum.cpp
@@ -23,17 +23,17 @@
 #include <math.h>
 #include <string.h>  // memmove
 
 #include "jstypes.h"
 
 #include "double-conversion/double-conversion.h"
 #include "js/CharacterEncoding.h"
 #include "js/Conversions.h"
-#if !ENABLE_INTL_API
+#if !JS_HAS_INTL_API
 #  include "js/LocaleSensitive.h"
 #endif
 #include "js/PropertySpec.h"
 #include "util/DoubleToString.h"
 #include "util/Memory.h"
 #include "util/StringBuffer.h"
 #include "vm/BigIntType.h"
 #include "vm/GlobalObject.h"
@@ -886,17 +886,17 @@ MOZ_ALWAYS_INLINE bool num_toString_impl
   return true;
 }
 
 bool js::num_toString(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   return CallNonGenericMethod<IsNumber, num_toString_impl>(cx, args);
 }
 
-#if !ENABLE_INTL_API
+#if !JS_HAS_INTL_API
 MOZ_ALWAYS_INLINE bool num_toLocaleString_impl(JSContext* cx,
                                                const CallArgs& args) {
   MOZ_ASSERT(IsNumber(args.thisv()));
 
   double d = Extract(args.thisv());
 
   RootedString str(cx, NumberToStringWithBase<CanGC>(cx, d, 10));
   if (!str) {
@@ -1028,17 +1028,17 @@ MOZ_ALWAYS_INLINE bool num_toLocaleStrin
   args.rval().setString(str);
   return true;
 }
 
 static bool num_toLocaleString(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   return CallNonGenericMethod<IsNumber, num_toLocaleString_impl>(cx, args);
 }
-#endif /* !ENABLE_INTL_API */
+#endif /* !JS_HAS_INTL_API */
 
 MOZ_ALWAYS_INLINE bool num_valueOf_impl(JSContext* cx, const CallArgs& args) {
   MOZ_ASSERT(IsNumber(args.thisv()));
   args.rval().setNumber(Extract(args.thisv()));
   return true;
 }
 
 bool js::num_valueOf(JSContext* cx, unsigned argc, Value* vp) {
@@ -1241,17 +1241,17 @@ MOZ_ALWAYS_INLINE bool num_toPrecision_i
 static bool num_toPrecision(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   return CallNonGenericMethod<IsNumber, num_toPrecision_impl>(cx, args);
 }
 
 static const JSFunctionSpec number_methods[] = {
     JS_FN(js_toSource_str, num_toSource, 0, 0),
     JS_FN(js_toString_str, num_toString, 1, 0),
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
     JS_SELF_HOSTED_FN(js_toLocaleString_str, "Number_toLocaleString", 0, 0),
 #else
     JS_FN(js_toLocaleString_str, num_toLocaleString, 0, 0),
 #endif
     JS_FN(js_valueOf_str, num_valueOf, 0, 0),
     JS_FN("toFixed", num_toFixed, 1, 0),
     JS_FN("toExponential", num_toExponential, 1, 0),
     JS_FN("toPrecision", num_toPrecision, 1, 0),
@@ -1268,20 +1268,20 @@ bool js::IsInteger(double d) {
 static const JSFunctionSpec number_static_methods[] = {
     JS_SELF_HOSTED_FN("isFinite", "Number_isFinite", 1, 0),
     JS_SELF_HOSTED_FN("isInteger", "Number_isInteger", 1, 0),
     JS_SELF_HOSTED_FN("isNaN", "Number_isNaN", 1, 0),
     JS_SELF_HOSTED_FN("isSafeInteger", "Number_isSafeInteger", 1, 0),
     JS_FS_END};
 
 bool js::InitRuntimeNumberState(JSRuntime* rt) {
-  // XXX If ENABLE_INTL_API becomes true all the time at some point,
+  // XXX If JS_HAS_INTL_API becomes true all the time at some point,
   //     js::InitRuntimeNumberState is no longer fallible, and we should
   //     change its return type.
-#if !ENABLE_INTL_API
+#if !JS_HAS_INTL_API
   /* Copy locale-specific separators into the runtime strings. */
   const char* thousandsSeparator;
   const char* decimalPoint;
   const char* grouping;
 #  ifdef HAVE_LOCALECONV
   struct lconv* locale = localeconv();
   thousandsSeparator = locale->thousands_sep;
   decimalPoint = locale->decimal_point;
@@ -1320,29 +1320,29 @@ bool js::InitRuntimeNumberState(JSRuntim
   storage += thousandsSeparatorSize;
 
   js_memcpy(storage, decimalPoint, decimalPointSize);
   rt->decimalSeparator = storage;
   storage += decimalPointSize;
 
   js_memcpy(storage, grouping, groupingSize);
   rt->numGrouping = grouping;
-#endif /* !ENABLE_INTL_API */
+#endif /* !JS_HAS_INTL_API */
   return true;
 }
 
 void js::FinishRuntimeNumberState(JSRuntime* rt) {
-#if !ENABLE_INTL_API
+#if !JS_HAS_INTL_API
   /*
    * The free also releases the memory for decimalSeparator and numGrouping
    * strings.
    */
   char* storage = const_cast<char*>(rt->thousandsSeparator.ref());
   js_free(storage);
-#endif  // !ENABLE_INTL_API
+#endif  // !JS_HAS_INTL_API
 }
 
 JSObject* NumberObject::createPrototype(JSContext* cx, JSProtoKey key) {
   NumberObject* numberProto =
       GlobalObject::createBlankPrototype<NumberObject>(cx, cx->global());
   if (!numberProto) {
     return nullptr;
   }
--- a/js/src/jsnum.h
+++ b/js/src/jsnum.h
@@ -35,17 +35,17 @@
 
 namespace js {
 
 class GlobalObject;
 class StringBuffer;
 
 extern MOZ_MUST_USE bool InitRuntimeNumberState(JSRuntime* rt);
 
-// This is a no-op if built with ENABLE_INTL_API.
+// This is a no-op if built with JS_HAS_INTL_API.
 extern void FinishRuntimeNumberState(JSRuntime* rt);
 
 /* Initialize the Number class, returning its prototype object. */
 extern JSObject* InitNumberClass(JSContext* cx, Handle<GlobalObject*> global);
 
 /*
  * When base == 10, this function implements ToString() as specified by
  * ECMA-262-5 section 9.8.1; but note that it handles integers specially for
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -375,17 +375,17 @@ SOURCES += [
     'builtin/RegExp.cpp',
     'jsmath.cpp',
     'util/DoubleToString.cpp',
     'util/Utility.cpp',
     'vm/Interpreter.cpp',
     'vm/ProfilingStack.cpp',
 ]
 
-if CONFIG['ENABLE_INTL_API']:
+if CONFIG['JS_HAS_INTL_API']:
     UNIFIED_SOURCES += [
         'builtin/intl/Collator.cpp',
         'builtin/intl/CommonFunctions.cpp',
         'builtin/intl/DateTimeFormat.cpp',
         'builtin/intl/IntlObject.cpp',
         'builtin/intl/LanguageTag.cpp',
         'builtin/intl/LanguageTagGenerated.cpp',
         'builtin/intl/ListFormat.cpp',
@@ -488,17 +488,17 @@ selfhosted_inputs = [
     'builtin/intl/CommonFunctions.js',
     'builtin/intl/CurrencyDataGenerated.js',
     'builtin/intl/DateTimeFormat.js',
     'builtin/intl/IntlObject.js',
     'builtin/intl/ListFormat.js',
     'builtin/intl/NumberFormat.js',
     'builtin/intl/PluralRules.js',
     'builtin/intl/RelativeTimeFormat.js',
-] if CONFIG['ENABLE_INTL_API'] else [])
+] if CONFIG['JS_HAS_INTL_API'] else [])
 
 # Prepare self-hosted JS code for embedding
 GeneratedFile('selfhosted.out.h', 'selfhosted.js',
               script='builtin/embedjs.py',
               entry_point='generate_selfhosted',
               inputs=selfhosted_inputs)
 
 if CONFIG['JS_HAS_CTYPES']:
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -1296,17 +1296,17 @@ static bool BindToAsyncStack(JSContext* 
   }
   SetFunctionNativeReserved(bound, 0, args[0]);
   SetFunctionNativeReserved(bound, 1, args[1]);
 
   args.rval().setObject(*bound);
   return true;
 }
 
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
 static bool AddIntlExtras(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   if (!args.get(0).isObject()) {
     JS_ReportErrorASCII(cx, "addIntlExtras must be passed an object");
     return false;
   }
   JS::RootedObject intl(cx, &args[0].toObject());
 
@@ -1330,17 +1330,17 @@ static bool AddIntlExtras(JSContext* cx,
 
   if (!js::AddListFormatConstructor(cx, intl)) {
     return false;
   }
 
   args.rval().setUndefined();
   return true;
 }
-#endif  // ENABLE_INTL_API
+#endif  // JS_HAS_INTL_API
 
 static MOZ_MUST_USE bool EvalUtf8AndPrint(JSContext* cx, const char* bytes,
                                           size_t length, int lineno,
                                           bool compileOnly) {
   // Eval.
   JS::CompileOptions options(cx);
   options.setIntroductionType("js shell interactive")
       .setIsRunOnce(true)
@@ -9064,25 +9064,25 @@ JS_FN_HELP("parseBin", BinParse, 1, 0,
 "  cause:    A string, supplied as the async cause on the top frame of\n"
 "            captured async stacks.\n"
 "\n"
 "  explicit: A boolean value, indicating whether the given 'stack' should\n"
 "            always supplant the returned function's true callers (true),\n"
 "            or only when there are no other JavaScript frames on the stack\n"
 "            below it (false). If omitted, this is treated as 'true'."),
 
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
     JS_FN_HELP("addIntlExtras", AddIntlExtras, 1, 0,
 "addIntlExtras(obj)",
 "Adds various not-yet-standardized Intl functions as properties on the\n"
 "provided object (this should generally be Intl itself).  The added\n"
 "functions and their behavior are experimental: don't depend upon them\n"
 "unless you're willing to update your code if these experimental APIs change\n"
 "underneath you."),
-#endif // ENABLE_INTL_API
+#endif // JS_HAS_INTL_API
 
     JS_FN_HELP("wasmCompileInSeparateProcess", WasmCompileInSeparateProcess, 1, 0,
 "wasmCompileInSeparateProcess(buffer)",
 "  Compile the given buffer in a separate process, serialize the resulting\n"
 "  wasm::Module into bytes, and deserialize those bytes in the current\n"
 "  process, returning the resulting WebAssembly.Module."),
 
     JS_FN_HELP("transplantableObject", TransplantableObject, 0, 0,
--- a/js/src/vm/DateTime.cpp
+++ b/js/src/vm/DateTime.cpp
@@ -19,22 +19,22 @@
 #if !defined(XP_WIN)
 #  include <limits.h>
 #  include <unistd.h>
 #endif /* !defined(XP_WIN) */
 
 #include "js/Date.h"
 #include "threading/ExclusiveData.h"
 
-#if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
+#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
 #  include "unicode/basictz.h"
 #  include "unicode/locid.h"
 #  include "unicode/timezone.h"
 #  include "unicode/unistr.h"
-#endif /* ENABLE_INTL_API && !MOZ_SYSTEM_ICU */
+#endif /* JS_HAS_INTL_API && !MOZ_SYSTEM_ICU */
 
 #include "util/Text.h"
 #include "vm/MutexIDs.h"
 
 static bool ComputeLocalTime(time_t local, struct tm* ptm) {
 #if defined(_WIN32)
   return localtime_s(ptm, &local) == 0;
 #elif defined(HAVE_LOCALTIME_R)
@@ -184,31 +184,31 @@ void js::DateTimeInfo::updateTimeZone() 
   if (updateIfChanged && newOffset == utcToLocalStandardOffsetSeconds_) {
     return;
   }
 
   utcToLocalStandardOffsetSeconds_ = newOffset;
 
   dstRange_.reset();
 
-#if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
+#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
   utcRange_.reset();
   localRange_.reset();
 
   {
     // Tell the analysis the |pFree| function pointer called by uprv_free
     // cannot GC.
     JS::AutoSuppressGCAnalysis nogc;
 
     timeZone_ = nullptr;
   }
 
   standardName_ = nullptr;
   daylightSavingsName_ = nullptr;
-#endif /* ENABLE_INTL_API && !MOZ_SYSTEM_ICU */
+#endif /* JS_HAS_INTL_API && !MOZ_SYSTEM_ICU */
 
   // Propagate the time zone change to ICU, too.
   {
     // Tell the analysis calling into ICU cannot GC.
     JS::AutoSuppressGCAnalysis nogc;
 
     internalResyncICUDefaultTimeZone();
   }
@@ -234,17 +234,17 @@ int64_t js::DateTimeInfo::toClampedSecon
   }
   return seconds;
 }
 
 int32_t js::DateTimeInfo::computeDSTOffsetMilliseconds(int64_t utcSeconds) {
   MOZ_ASSERT(utcSeconds >= MinTimeT);
   MOZ_ASSERT(utcSeconds <= MaxTimeT);
 
-#if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
+#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
   UDate date = UDate(utcSeconds * msPerSecond);
   constexpr bool dateIsLocalTime = false;
   int32_t rawOffset, dstOffset;
   UErrorCode status = U_ZERO_ERROR;
 
   timeZone()->getOffset(date, dateIsLocalTime, rawOffset, dstOffset, status);
   if (U_FAILURE(status)) {
     return 0;
@@ -268,17 +268,17 @@ int32_t js::DateTimeInfo::computeDSTOffs
 
   if (diff < 0) {
     diff += SecondsPerDay;
   } else if (uint32_t(diff) >= SecondsPerDay) {
     diff -= SecondsPerDay;
   }
 
   return diff * msPerSecond;
-#endif /* ENABLE_INTL_API && !MOZ_SYSTEM_ICU */
+#endif /* JS_HAS_INTL_API && !MOZ_SYSTEM_ICU */
 }
 
 int32_t js::DateTimeInfo::internalGetDSTOffsetMilliseconds(
     int64_t utcMilliseconds) {
   int64_t utcSeconds = toClampedSeconds(utcMilliseconds);
   return getOrComputeValue(dstRange_, utcSeconds,
                            &DateTimeInfo::computeDSTOffsetMilliseconds);
 }
@@ -376,17 +376,17 @@ void js::DateTimeInfo::RangeCache::sanit
     MOZ_ASSERT_IF(start != INT64_MIN, start >= MinTimeT && end >= MinTimeT);
     MOZ_ASSERT_IF(start != INT64_MIN, start <= MaxTimeT && end <= MaxTimeT);
   };
 
   assertRange(startSeconds, endSeconds);
   assertRange(oldStartSeconds, oldEndSeconds);
 }
 
-#if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
+#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
 int32_t js::DateTimeInfo::computeUTCOffsetMilliseconds(int64_t localSeconds) {
   MOZ_ASSERT(localSeconds >= MinTimeT);
   MOZ_ASSERT(localSeconds <= MaxTimeT);
 
   UDate date = UDate(localSeconds * msPerSecond);
 
   // ES2019 draft rev 0ceb728a1adbffe42b26972a6541fd7f398b1557
   //
@@ -501,17 +501,17 @@ bool js::DateTimeInfo::internalTimeZoneD
 icu::TimeZone* js::DateTimeInfo::timeZone() {
   if (!timeZone_) {
     timeZone_.reset(icu::TimeZone::createDefault());
     MOZ_ASSERT(timeZone_);
   }
 
   return timeZone_.get();
 }
-#endif /* ENABLE_INTL_API && !MOZ_SYSTEM_ICU */
+#endif /* JS_HAS_INTL_API && !MOZ_SYSTEM_ICU */
 
 /* static */ js::ExclusiveData<js::DateTimeInfo>* js::DateTimeInfo::instance;
 
 bool js::InitDateTimeState() {
   MOZ_ASSERT(!DateTimeInfo::instance, "we should be initializing only once");
 
   DateTimeInfo::instance =
       js_new<ExclusiveData<DateTimeInfo>>(mutexid::DateTimeInfoMutex);
@@ -576,17 +576,17 @@ static bool IsOlsonCompatibleWindowsTime
   };
   for (const auto& allowedId : allowedIds) {
     if (std::strcmp(allowedId, tz) == 0) {
       return true;
     }
   }
   return false;
 }
-#elif ENABLE_INTL_API && !MOZ_SYSTEM_ICU
+#elif JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
 static inline const char* TZContainsAbsolutePath(const char* tzVar) {
   // A TZ environment variable may be an absolute path. The path
   // format of TZ may begin with a colon. (ICU handles relative paths.)
   if (tzVar[0] == ':' && tzVar[1] == '/') {
     return tzVar + 1;
   }
   if (tzVar[0] == '/') {
     return tzVar;
@@ -713,24 +713,24 @@ static icu::UnicodeString ReadTimeZoneLi
       continue;
     }
 
     return icu::UnicodeString();
   }
 
   return icu::UnicodeString(timeZone, timeZoneLen, US_INV);
 }
-#endif /* ENABLE_INTL_API && !MOZ_SYSTEM_ICU */
+#endif /* JS_HAS_INTL_API && !MOZ_SYSTEM_ICU */
 
 void js::ResyncICUDefaultTimeZone() {
   js::DateTimeInfo::resyncICUDefaultTimeZone();
 }
 
 void js::DateTimeInfo::internalResyncICUDefaultTimeZone() {
-#if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
+#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
   if (const char* tz = std::getenv("TZ")) {
     icu::UnicodeString tzid;
 
 #  if defined(XP_WIN)
     // If TZ is set and its value is valid under Windows' and IANA's time zone
     // identifier rules, update the ICU default time zone to use this value.
     if (IsOlsonCompatibleWindowsTimeZoneId(tz)) {
       tzid.setTo(icu::UnicodeString(tz, -1, US_INV));
--- a/js/src/vm/DateTime.h
+++ b/js/src/vm/DateTime.h
@@ -12,23 +12,23 @@
 #include "mozilla/UniquePtr.h"
 #include "mozilla/Unused.h"
 
 #include <stdint.h>
 
 #include "js/Utility.h"
 #include "threading/ExclusiveData.h"
 
-#if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
+#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
 #  include "unicode/uversion.h"
 
 U_NAMESPACE_BEGIN
 class TimeZone;
 U_NAMESPACE_END
-#endif /* ENABLE_INTL_API && !MOZ_SYSTEM_ICU */
+#endif /* JS_HAS_INTL_API && !MOZ_SYSTEM_ICU */
 
 namespace js {
 
 /* Constants defined by ES5 15.9.1.10. */
 constexpr double HoursPerDay = 24;
 constexpr double MinutesPerHour = 60;
 constexpr double SecondsPerMinute = 60;
 constexpr double msPerSecond = 1000;
@@ -161,17 +161,17 @@ class DateTimeInfo {
    * standard time (i.e. not including any offset due to DST) as computed by the
    * operating system.
    */
   static int32_t utcToLocalStandardOffsetSeconds() {
     auto guard = acquireLockWithValidTimeZone();
     return guard->utcToLocalStandardOffsetSeconds_;
   }
 
-#if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
+#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
   enum class TimeZoneOffset { UTC, Local };
 
   /**
    * Return the time zone offset, including DST, in milliseconds at the
    * given time. The input time can be either at UTC or at local time.
    */
   static int32_t getOffsetMilliseconds(int64_t milliseconds,
                                        TimeZoneOffset offset) {
@@ -194,17 +194,17 @@ class DateTimeInfo {
 #else
   /**
    * Return the local time zone adjustment (ES2019 20.3.1.7) as computed by
    * the operating system.
    */
   static int32_t localTZA() {
     return utcToLocalStandardOffsetSeconds() * msPerSecond;
   }
-#endif /* ENABLE_INTL_API && !MOZ_SYSTEM_ICU */
+#endif /* JS_HAS_INTL_API && !MOZ_SYSTEM_ICU */
 
  private:
   // The two methods below should only be called via js::ResetTimeZoneInternal()
   // and js::ResyncICUDefaultTimeZone().
   friend void js::ResetTimeZoneInternal(ResetTimeZoneMode);
   friend void js::ResyncICUDefaultTimeZone();
 
   static void resetTimeZone(ResetTimeZoneMode mode) {
@@ -260,26 +260,26 @@ class DateTimeInfo {
    * and instead infers the default time zone via "/etc/localtime" (on Unix).
    * This offset can also differ from ICU when the operating system and ICU use
    * different tzdata versions and the time zone rules of the current system
    * time zone have changed. Or, on Windows, when the Windows default time zone
    * can't be mapped to a IANA time zone, see for example
    * <https://unicode-org.atlassian.net/browse/ICU-13845>.
    *
    * When ICU is exclusively used for time zone computations, that means when
-   * |ENABLE_INTL_API && !MOZ_SYSTEM_ICU| is true, this field is only used to
+   * |JS_HAS_INTL_API && !MOZ_SYSTEM_ICU| is true, this field is only used to
    * detect system default time zone changes. It must not be used to convert
    * between local and UTC time, because, as outlined above, this could lead to
    * different results when compared to ICU.
    */
   int32_t utcToLocalStandardOffsetSeconds_;
 
   RangeCache dstRange_;  // UTC-based ranges
 
-#if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
+#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
   // ICU's TimeZone class is currently only available through the C++ API,
   // see <https://unicode-org.atlassian.net/browse/ICU-13706>. Due to the
   // lack of a stable ABI in C++, we therefore need to restrict this class
   // to only use ICU when we use our in-tree ICU copy.
 
   // Use the full date-time range when we can use ICU's TimeZone support.
   static constexpr int64_t MinTimeT =
       static_cast<int64_t>(StartOfTime / msPerSecond);
@@ -306,17 +306,17 @@ class DateTimeInfo {
   // Restrict the data-time range to the minimum required time_t range as
   // specified in POSIX. Most operating systems support 64-bit time_t
   // values, but we currently still have some configurations which use
   // 32-bit time_t, e.g. the ARM simulator on 32-bit Linux (bug 1406993).
   // Bug 1406992 explores to use 64-bit time_t when supported by the
   // underlying operating system.
   static constexpr int64_t MinTimeT = 0;          /* time_t 01/01/1970 */
   static constexpr int64_t MaxTimeT = 2145830400; /* time_t 12/31/2037 */
-#endif /* ENABLE_INTL_API && !MOZ_SYSTEM_ICU */
+#endif /* JS_HAS_INTL_API && !MOZ_SYSTEM_ICU */
 
   static constexpr int64_t RangeExpansionAmount = 30 * SecondsPerDay;
 
   void internalResetTimeZone(ResetTimeZoneMode mode);
 
   void updateTimeZone();
 
   void internalResyncICUDefaultTimeZone();
@@ -335,17 +335,17 @@ class DateTimeInfo {
    * Compute the DST offset at the given UTC time in seconds from the epoch.
    * (getDSTOffsetMilliseconds attempts to return a cached value from the
    * dstRange_ member, but in case of a cache miss it calls this method.)
    */
   int32_t computeDSTOffsetMilliseconds(int64_t utcSeconds);
 
   int32_t internalGetDSTOffsetMilliseconds(int64_t utcMilliseconds);
 
-#if ENABLE_INTL_API && !MOZ_SYSTEM_ICU
+#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
   /**
    * Compute the UTC offset in milliseconds for the given local time. Called
    * by internalGetOffsetMilliseconds on a cache miss.
    */
   int32_t computeUTCOffsetMilliseconds(int64_t localSeconds);
 
   /**
    * Compute the local time offset in milliseconds for the given UTC time.
@@ -355,14 +355,14 @@ class DateTimeInfo {
 
   int32_t internalGetOffsetMilliseconds(int64_t milliseconds,
                                         TimeZoneOffset offset);
 
   bool internalTimeZoneDisplayName(char16_t* buf, size_t buflen,
                                    int64_t utcMilliseconds, const char* locale);
 
   icu::TimeZone* timeZone();
-#endif /* ENABLE_INTL_API && !MOZ_SYSTEM_ICU */
+#endif /* JS_HAS_INTL_API && !MOZ_SYSTEM_ICU */
 };
 
 } /* namespace js */
 
 #endif /* vm_DateTime_h */
--- a/js/src/vm/GlobalObject.cpp
+++ b/js/src/vm/GlobalObject.cpp
@@ -10,17 +10,17 @@
 #include "jsdate.h"
 #include "jsexn.h"
 #include "jsfriendapi.h"
 
 #include "builtin/AtomicsObject.h"
 #include "builtin/BigInt.h"
 #include "builtin/DataViewObject.h"
 #include "builtin/Eval.h"
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
 #  include "builtin/intl/Collator.h"
 #  include "builtin/intl/DateTimeFormat.h"
 #  include "builtin/intl/ListFormat.h"
 #  include "builtin/intl/Locale.h"
 #  include "builtin/intl/NumberFormat.h"
 #  include "builtin/intl/PluralRules.h"
 #  include "builtin/intl/RelativeTimeFormat.h"
 #endif
--- a/js/src/vm/Initialization.cpp
+++ b/js/src/vm/Initialization.cpp
@@ -16,21 +16,21 @@
 #include "builtin/AtomicsObject.h"
 #include "ds/MemoryProtectionExceptionHandler.h"
 #include "gc/Statistics.h"
 #include "jit/AtomicOperations.h"
 #include "jit/ExecutableAllocator.h"
 #include "jit/Ion.h"
 #include "jit/JitCommon.h"
 #include "js/Utility.h"
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
 #  include "unicode/putil.h"
 #  include "unicode/uclean.h"
 #  include "unicode/utypes.h"
-#endif  // ENABLE_INTL_API
+#endif  // JS_HAS_INTL_API
 #include "util/Poison.h"
 #include "vm/BigIntType.h"
 #include "vm/DateTime.h"
 #include "vm/HelperThreads.h"
 #include "vm/Runtime.h"
 #include "vm/Time.h"
 #include "vm/TraceLogging.h"
 #ifdef MOZ_VTUNE
@@ -161,30 +161,30 @@ JS_PUBLIC_API const char* JS::detail::In
   RETURN_IF_FAIL(js::InitDateTimeState());
 
 #ifdef MOZ_VTUNE
   RETURN_IF_FAIL(js::vtune::Initialize());
 #endif
 
   RETURN_IF_FAIL(js::jit::AtomicOperations::Initialize());
 
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
 #  if !MOZ_SYSTEM_ICU
   // Explicitly set the data directory to its default value, but only when we're
   // sure that we use our in-tree ICU copy. See bug 1527879 and ICU bug
   // report <https://unicode-org.atlassian.net/browse/ICU-20491>.
   u_setDataDirectory("");
 #  endif
 
   UErrorCode err = U_ZERO_ERROR;
   u_init(&err);
   if (U_FAILURE(err)) {
     return "u_init() failed";
   }
-#endif  // ENABLE_INTL_API
+#endif  // JS_HAS_INTL_API
 
   RETURN_IF_FAIL(js::CreateHelperThreadsState());
   RETURN_IF_FAIL(FutexThread::initialize());
   RETURN_IF_FAIL(js::gcstats::Statistics::initialize());
 
 #ifdef JS_SIMULATOR
   RETURN_IF_FAIL(js::jit::SimulatorProcess::initialize());
 #endif
@@ -238,19 +238,19 @@ JS_PUBLIC_API void JS_ShutDown(void) {
   // PRMJ_Now subsystem.  (For reinitialization to be permitted, we'd need to
   // "reset" the called-once status -- doable, but more trouble than it's
   // worth now.)  Initializing that subsystem from JS_Init eliminates the
   // problem, but initialization can take a comparatively long time (15ms or
   // so), so we really don't want to do it in JS_Init, and we really do want
   // to do it only when PRMJ_Now is eventually called.
   PRMJ_NowShutdown();
 
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
   u_cleanup();
-#endif  // ENABLE_INTL_API
+#endif  // JS_HAS_INTL_API
 
 #ifdef MOZ_VTUNE
   js::vtune::Shutdown();
 #endif  // MOZ_VTUNE
 
   js::FinishDateTimeState();
 
   if (!JSRuntime::hasLiveRuntimes()) {
@@ -265,17 +265,17 @@ JS_PUBLIC_API void JS_ShutDown(void) {
 
 JS_PUBLIC_API bool JS_SetICUMemoryFunctions(JS_ICUAllocFn allocFn,
                                             JS_ICUReallocFn reallocFn,
                                             JS_ICUFreeFn freeFn) {
   MOZ_ASSERT(libraryInitState == InitState::Uninitialized,
              "must call JS_SetICUMemoryFunctions before any other JSAPI "
              "operation (including JS_Init)");
 
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
   UErrorCode status = U_ZERO_ERROR;
   u_setMemoryFunctions(/* context = */ nullptr, allocFn, reallocFn, freeFn,
                        &status);
   return U_SUCCESS(status);
 #else
   return true;
 #endif
 }
--- a/js/src/vm/Runtime.cpp
+++ b/js/src/vm/Runtime.cpp
@@ -34,17 +34,17 @@
 #include "jit/JitRealm.h"
 #include "jit/mips32/Simulator-mips32.h"
 #include "jit/mips64/Simulator-mips64.h"
 #include "js/Date.h"
 #include "js/MemoryMetrics.h"
 #include "js/SliceBudget.h"
 #include "js/StableStringChars.h"
 #include "js/Wrapper.h"
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
 #  include "unicode/uloc.h"
 #endif
 #include "util/Windows.h"
 #include "vm/DateTime.h"
 #include "vm/JSAtom.h"
 #include "vm/JSObject.h"
 #include "vm/JSScript.h"
 #include "vm/TraceLogging.h"
@@ -131,17 +131,17 @@ JSRuntime::JSRuntime(JSRuntime* parentRu
       scriptAndCountsVector(nullptr),
       lcovOutput_(),
       jitRuntime_(nullptr),
       selfHostingGlobal_(nullptr),
       gc(thisFromCtor()),
       gcInitialized(false),
       emptyString(nullptr),
       defaultFreeOp_(nullptr),
-#if !ENABLE_INTL_API
+#if !JS_HAS_INTL_API
       thousandsSeparator(nullptr),
       decimalSeparator(nullptr),
       numGrouping(nullptr),
 #endif
       beingDestroyed_(false),
       allowContentJS_(true),
       atoms_(nullptr),
       permanentAtomsDuringInit_(nullptr),
@@ -237,17 +237,17 @@ bool JSRuntime::init(JSContext* cx, uint
   return true;
 }
 
 void JSRuntime::destroyRuntime() {
   MOZ_ASSERT(!JS::RuntimeHeapIsBusy());
   MOZ_ASSERT(childRuntimeCount == 0);
   MOZ_ASSERT(initialized_);
 
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
   sharedIntlData.ref().destroyInstance();
 #endif
 
   if (gcInitialized) {
     /*
      * Finish any in-progress GCs first. This ensures the parseWaitingOnGC
      * list is empty in CancelOffThreadParses.
      */
@@ -291,17 +291,17 @@ void JSRuntime::destroyRuntime() {
 
 #ifdef DEBUG
   {
     AutoLockScriptData lock(this);
     MOZ_ASSERT(scriptDataTable(lock).empty());
   }
 #endif
 
-#if !ENABLE_INTL_API
+#if !JS_HAS_INTL_API
   FinishRuntimeNumberState(this);
 #endif
 
   gc.finish();
 
   defaultLocale = nullptr;
   js_delete(jitRuntime_.ref());
 
@@ -365,17 +365,17 @@ void JSRuntime::addSizeOfIncludingThis(m
       gc.nursery().sizeOfMallocedBuffers(mallocSizeOf);
   gc.storeBuffer().addSizeOfExcludingThis(mallocSizeOf, &rtSizes->gc);
 
   if (sharedImmutableStrings_) {
     rtSizes->sharedImmutableStringsCache +=
         sharedImmutableStrings_->sizeOfExcludingThis(mallocSizeOf);
   }
 
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
   rtSizes->sharedIntlData +=
       sharedIntlData.ref().sizeOfExcludingThis(mallocSizeOf);
 #endif
 
   {
     AutoLockScriptData lock(this);
     rtSizes->scriptData +=
         scriptDataTable(lock).shallowSizeOfExcludingThis(mallocSizeOf);
@@ -539,17 +539,17 @@ void JSRuntime::resetDefaultLocale() { d
 
 const char* JSRuntime::getDefaultLocale() {
   if (defaultLocale.ref()) {
     return defaultLocale.ref().get();
   }
 
   // Use ICU if available to retrieve the default locale, this ensures ICU's
   // default locale matches our default locale.
-#if ENABLE_INTL_API
+#if JS_HAS_INTL_API
   const char* locale = uloc_getDefault();
 #else
   const char* locale = setlocale(LC_ALL, nullptr);
 #endif
 
   // convert to a well-formed BCP 47 language tag
   if (!locale || !strcmp(locale, "C")) {
     locale = "und";
@@ -567,17 +567,17 @@ const char* JSRuntime::getDefaultLocale(
   while ((p = strchr(lang.get(), '_'))) {
     *p = '-';
   }
 
   defaultLocale.ref() = std::move(lang);
   return defaultLocale.ref().get();
 }
 
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
 void JSRuntime::traceSharedIntlData(JSTracer* trc) {
   sharedIntlData.ref().trace(trc);
 }
 #endif
 
 JSFreeOp::JSFreeOp(JSRuntime* maybeRuntime, bool isDefault)
     : runtime_(maybeRuntime), isDefault(isDefault), isCollecting_(!isDefault) {
   MOZ_ASSERT_IF(maybeRuntime, CurrentThreadCanAccessRuntime(maybeRuntime));
--- a/js/src/vm/Runtime.h
+++ b/js/src/vm/Runtime.h
@@ -17,17 +17,17 @@
 #include "mozilla/ThreadLocal.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Vector.h"
 
 #include <algorithm>
 #include <setjmp.h>
 
 #include "builtin/AtomicsObject.h"
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
 #  include "builtin/intl/SharedIntlData.h"
 #endif
 #include "builtin/Promise.h"
 #include "frontend/BinASTRuntimeSupport.h"
 #include "frontend/NameCollections.h"
 #include "gc/GCRuntime.h"
 #include "gc/Tracer.h"
 #include "irregexp/RegExpStack.h"
@@ -679,17 +679,17 @@ struct JSRuntime {
   js::MainThreadOrGCTaskData<JSFreeOp*> defaultFreeOp_;
 
  public:
   JSFreeOp* defaultFreeOp() {
     MOZ_ASSERT(defaultFreeOp_);
     return defaultFreeOp_;
   }
 
-#if !ENABLE_INTL_API
+#if !JS_HAS_INTL_API
   /* Number localization, used by jsnum.cpp. */
   js::WriteOnceData<const char*> thousandsSeparator;
   js::WriteOnceData<const char*> decimalSeparator;
   js::WriteOnceData<const char*> numGrouping;
 #endif
 
  private:
   mozilla::Maybe<js::SharedImmutableStringsCache> sharedImmutableStrings_;
@@ -799,17 +799,17 @@ struct JSRuntime {
 
   bool initMainAtomsTables(JSContext* cx);
   void tracePermanentAtoms(JSTracer* trc);
 
   // Cached well-known symbols (ES6 rev 24 6.1.5.1). Like permanent atoms,
   // these are shared with the parentRuntime, if any.
   js::WriteOnceData<js::WellKnownSymbols*> wellKnownSymbols;
 
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
   /* Shared Intl data for this runtime. */
   js::MainThreadData<js::intl::SharedIntlData> sharedIntlData;
 
   void traceSharedIntlData(JSTracer* trc);
 #endif
 
   // Table of bytecode and other data that may be shared across scripts
   // within the runtime. This may be modified by threads using
--- a/js/src/vm/SelfHosting.cpp
+++ b/js/src/vm/SelfHosting.cpp
@@ -16,17 +16,17 @@
 #include <iterator>
 
 #include "jsdate.h"
 #include "jsfriendapi.h"
 #include "selfhosted.out.h"
 
 #include "builtin/Array.h"
 #include "builtin/BigInt.h"
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
 #  include "builtin/intl/Collator.h"
 #  include "builtin/intl/DateTimeFormat.h"
 #  include "builtin/intl/IntlObject.h"
 #  include "builtin/intl/ListFormat.h"
 #  include "builtin/intl/Locale.h"
 #  include "builtin/intl/NumberFormat.h"
 #  include "builtin/intl/PluralRules.h"
 #  include "builtin/intl/RelativeTimeFormat.h"
@@ -1756,17 +1756,17 @@ bool js::ReportIncompatibleSelfHostedMet
     }
     ++iter;
   }
 
   MOZ_ASSERT_UNREACHABLE("How did we not find a useful self-hosted frame?");
   return false;
 }
 
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
 /**
  * Returns the default locale as a well-formed, but not necessarily
  * canonicalized, BCP-47 language tag.
  */
 static bool intrinsic_RuntimeDefaultLocale(JSContext* cx, unsigned argc,
                                            Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   MOZ_ASSERT(args.length() == 0);
@@ -1811,17 +1811,17 @@ static bool intrinsic_IsRuntimeDefaultLo
   if (!str) {
     return false;
   }
 
   bool equals = StringEqualsAscii(str, locale);
   args.rval().setBoolean(equals);
   return true;
 }
-#endif  // ENABLE_INTL_API
+#endif  // JS_HAS_INTL_API
 
 static bool intrinsic_ThrowArgTypeNotObject(JSContext* cx, unsigned argc,
                                             Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   MOZ_ASSERT(args.length() == 2);
   MOZ_ASSERT(args[0].isNumber());
   MOZ_ASSERT(!args[1].isObject());
   if (args[0].toNumber() == NOT_OBJECT_KIND_DESCRIPTOR) {
@@ -2415,17 +2415,17 @@ static const JSFunctionSpec intrinsic_fu
 // clang-format off
 #define LOAD_AND_STORE_REFERENCE_FN_DECLS(_constant, _type, _name)      \
     JS_FN("Store_" #_name, js::StoreReference##_name::Func, 3, 0),      \
     JS_FN("Load_" #_name,  js::LoadReference##_name::Func, 3, 0),
     JS_FOR_EACH_REFERENCE_TYPE_REPR(LOAD_AND_STORE_REFERENCE_FN_DECLS)
 // clang-format on
 #undef LOAD_AND_STORE_REFERENCE_FN_DECLS
 
-#ifdef ENABLE_INTL_API
+#ifdef JS_HAS_INTL_API
     // See builtin/intl/*.h for descriptions of the intl_* functions.
     JS_FN("intl_availableCalendars", intl_availableCalendars, 1, 0),
     JS_FN("intl_availableCollations", intl_availableCollations, 1, 0),
 #  if DEBUG || MOZ_SYSTEM_ICU
     JS_FN("intl_availableMeasurementUnits", intl_availableMeasurementUnits, 0,
           0),
 #  endif
     JS_FN("intl_BestAvailableLocale", intl_BestAvailableLocale, 3, 0),
@@ -2496,17 +2496,17 @@ static const JSFunctionSpec intrinsic_fu
           CallNonGenericSelfhostedMethod<Is<NumberFormatObject>>, 2, 0),
     JS_FN("CallPluralRulesMethodIfWrapped",
           CallNonGenericSelfhostedMethod<Is<PluralRulesObject>>, 2, 0),
     JS_FN("CallRelativeTimeFormatMethodIfWrapped",
           CallNonGenericSelfhostedMethod<Is<RelativeTimeFormatObject>>, 2, 0),
 
     JS_FN("RuntimeDefaultLocale", intrinsic_RuntimeDefaultLocale, 0, 0),
     JS_FN("IsRuntimeDefaultLocale", intrinsic_IsRuntimeDefaultLocale, 1, 0),
-#endif  // ENABLE_INTL_API
+#endif  // JS_HAS_INTL_API
 
     JS_FN("GetOwnPropertyDescriptorToArray", GetOwnPropertyDescriptorToArray, 2,
           0),
 
     JS_INLINABLE_FN("IsRegExpObject",
                     intrinsic_IsInstanceOfBuiltin<RegExpObject>, 1, 0,
                     IsRegExpObject),
     JS_INLINABLE_FN("IsPossiblyWrappedRegExpObject",
--- a/js/src/vm/Time.cpp
+++ b/js/src/vm/Time.cpp
@@ -241,17 +241,17 @@ static int64_t PRMJ_NowImpl() {
     // cannot maintain the invariant that Date.now() never
     // decreases; the old implementation has this behavior as
     // well.
     needsCalibration = true;
   }
 }
 #endif
 
-#if !ENABLE_INTL_API || MOZ_SYSTEM_ICU
+#if !JS_HAS_INTL_API || MOZ_SYSTEM_ICU
 #  ifdef XP_WIN
 static void PRMJ_InvalidParameterHandler(const wchar_t* expression,
                                          const wchar_t* function,
                                          const wchar_t* file, unsigned int line,
                                          uintptr_t pReserved) {
   /* empty */
 }
 #  endif
@@ -389,9 +389,9 @@ size_t PRMJ_FormatTime(char* buf, size_t
       memcpy(p, real_year, real_year_len);
       result = new_result;
       *(buf + result) = '\0';
     }
   }
 #  endif
   return result;
 }
-#endif /* !ENABLE_INTL_API || MOZ_SYSTEM_ICU */
+#endif /* !JS_HAS_INTL_API || MOZ_SYSTEM_ICU */
--- a/js/src/vm/Time.h
+++ b/js/src/vm/Time.h
@@ -8,17 +8,17 @@
 #define vm_Time_h
 
 #include "mozilla/RecordReplay.h"
 #include "mozilla/TimeStamp.h"
 
 #include <stddef.h>
 #include <stdint.h>
 
-#if !ENABLE_INTL_API || MOZ_SYSTEM_ICU
+#if !JS_HAS_INTL_API || MOZ_SYSTEM_ICU
 /*
  * Broken down form of 64 bit time value.
  */
 struct PRMJTime {
   int32_t tm_usec; /* microseconds of second (0-999999) */
   int8_t tm_sec;   /* seconds of minute (0-59) */
   int8_t tm_min;   /* minutes of hour (0-59) */
   int8_t tm_hour;  /* hour of day (0-23) */
@@ -47,17 +47,17 @@ inline void PRMJ_NowInit() {}
 
 /* Release the resources associated with PRMJ_Now; don't call PRMJ_Now again */
 #ifdef XP_WIN
 extern void PRMJ_NowShutdown();
 #else
 inline void PRMJ_NowShutdown() {}
 #endif
 
-#if !ENABLE_INTL_API || MOZ_SYSTEM_ICU
+#if !JS_HAS_INTL_API || MOZ_SYSTEM_ICU
 /* Format a time value into a buffer. Same semantics as strftime() */
 extern size_t PRMJ_FormatTime(char* buf, size_t buflen, const char* fmt,
                               const PRMJTime* tm, int timeZoneYear,
                               int offsetInSeconds);
 #endif
 
 /**
  * Requesting the number of cycles from the CPU.
--- a/js/src/wasm/WasmModule.cpp
+++ b/js/src/wasm/WasmModule.cpp
@@ -1191,17 +1191,17 @@ bool Module::makeStructTypeDescrs(
   if (structTypes().length() == 0) {
     return true;
   }
 
 #ifndef ENABLE_WASM_GC
   MOZ_CRASH("Should not have seen any struct types");
 #else
 
-#  ifndef ENABLE_TYPED_OBJECTS
+#  ifndef JS_HAS_TYPED_OBJECTS
 #    error "GC types require TypedObject"
 #  endif
 
   // Not just any prototype object will do, we must have the actual
   // StructTypePrototype.
   RootedObject typedObjectModule(
       cx, GlobalObject::getOrCreateTypedObjectModule(cx, cx->global()));
   if (!typedObjectModule) {
--- a/js/sub.configure
+++ b/js/sub.configure
@@ -51,17 +51,17 @@ def js_subconfigure(build_env, prepare_c
 
     options = [
         o for o in prepare_configure_options.options
         # --with-system-nspr will have been converted into the relevant $NSPR_CFLAGS
         # and $NSPR_LIBS.
         if not o.startswith('--with-system-nspr')
     ]
 
-    if not substs.get('ENABLE_INTL_API'):
+    if not substs.get('JS_HAS_INTL_API'):
         options.append('--without-intl-api')
 
     if substs.get('NSPR_CFLAGS') or substs.get('NSPR_LIBS'):
         options.append(
             '--with-nspr-cflags=%s' % ' '.join(substs.get('NSPR_CFLAGS', [])))
         options.append(
             '--with-nspr-libs=%s' % ' '.join(substs.get('NSPR_LIBS', [])))
 
--- a/js/xpconnect/src/XPCLocale.cpp
+++ b/js/xpconnect/src/XPCLocale.cpp
@@ -65,17 +65,17 @@ XPCLocaleObserver::Observe(nsISupports* 
  * XPCLocaleCallbacks are limited to the main thread.
  */
 struct XPCLocaleCallbacks : public JSLocaleCallbacks {
   XPCLocaleCallbacks() {
     MOZ_COUNT_CTOR(XPCLocaleCallbacks);
 
     // Disable the toLocaleUpper/Lower case hooks to use the standard,
     // locale-insensitive definition from String.prototype. (These hooks are
-    // only consulted when ENABLE_INTL_API is not set.) Since ENABLE_INTL_API
+    // only consulted when JS_HAS_INTL_API is not set.) Since JS_HAS_INTL_API
     // is always set, these hooks should be disabled.
     localeToUpperCase = nullptr;
     localeToLowerCase = nullptr;
     localeCompare = nullptr;
     localeToUnicode = nullptr;
 
     // It's going to be retained by the ObserverService.
     RefPtr<XPCLocaleObserver> locObs = new XPCLocaleObserver();